usermod(1M) usermod(1M)
NAME
usermod - modify a user's login information on the system
SYNOPSIS
usermod [-u uid [-o]] [-g group] [-G group[,group ...] [-d dir [-m]]
[-s shell] [-c comment] [-l newlogname] [-f inactive]
[-e expire] [-a [operator] [event] [,...]] login
DESCRIPTION
The usermod command modifies a user's login definition on the system.
It changes the definition of the specified login and makes the
appropriate login-related system file and file system changes.
The system file entries created with this command have a limit of 512
characters per line. Specifying long arguments to several options may
exceed this limit.
OPTIONS
-u uid New UID for the user. It must be a non-negative decimal
integer below MAXUID as defined in <param.h>.
-o This option allows the specified UID to be duplicated
(non-unique).
-g group An existing group's integer ID or character-string name.
It redefines the user's primary group membership.
-G group An existing group's integer ID, or character string name.
It redefines the user's supplementary group membership.
Duplicates between group with the -g and -G options are
ignored. No more than NGROUPSUMAX groups may be speci-
fied as defined in <param.h>.
-d dir The new home directory of the user. It defaults to
basedir/login, where basedir is the base directory for
the specified login home directories, and login is the
specified login. The entry in the /etc/passwd file is
modified and not the HOME directory itself. The HOME
directory is only moved or modified in conjunction with
the -m option.
-m Moves the user's home directory to the new directory
specified with the -d option. If the directory already
exists, it must have permissions read/write/execute for
group, where group is the user's primary group.
-s shell Full pathname of the program that is used as the user's
shell at login. The value of shell must be a valid exe-
cutable file.
Page 1 Reliant UNIX 5.44 Printed 11/98
usermod(1M) usermod(1M)
-c comment Any text string. It is generally a short description of
the login, and is currently used as the field for the
user's full name. This information is stored in the
user's /etc/passwd entry.
-l newlogname
A string of printable characters that specifies the new
login name for the user. It may not contain a colon (:)
or a newline (\n).
-e expire The date on which a login can no longer be used; after
this date, no user will be able to access this login.
(This option is useful for creating temporary logins.)
You may type the value of the argument expire (which is a
date) in any format you like (except a Julian date). For
example, you may enter 10/6/90 or October 6, 1990. A
value of "" defeats the status of the expired date.
-f inactive The maximum number of days allowed between uses of a
login ID before that login ID is declared invalid. Normal
values are positive integers. A value of 0 defeats the
status.
[-a [operator][event][,...]]
Set the user's audit mask based on the event(s) speci-
fied. The following operators are available: + to add the
events to the user's audit mask, - to delete the events
to the user's audit mask, = to replace the user's audit
mask. If no operator is specified, the = operator
(replace) is assumed. This option is only valid if the
auditing subsystem is installed.
login A string of printable characters that specifies the
existing login name of the user. It must exist and may
not contain a colon (:), or a newline (\n).
DIAGNOSTICS
The usermod command exits with one of the following values:
0 = The command was executed successfully.
2 = The command syntax was invalid. A usage message for the usermod
command is displayed.
3 = An invalid argument was provided to an option.
4 = The uid given with the -u option is already in use.
6 = The login to be modified does not exist or group does not exist.
8 = The login to be modified is in use.
Page 2 Reliant UNIX 5.44 Printed 11/98
usermod(1M) usermod(1M)
9 = The newlogname is already in use.
10 = Cannot update the /etc/group file. Other update requests will be
implemented.
11 = Insufficient space to move the home directory (-m option). Other
update requests will be implemented.
12 = Unable to complete the move of the home directory to the new
home directory.
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed.
If LCMESSAGES is undefined or is defined as the null string, it
defaults to the value of LANG. If LANG is likewise undefined or null,
the system acts as if it were not internationalized.
If any of the locale variables has an invalid value, the system acts
as if none of the variables was set.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
FILES
/etc/passwd
/etc/shadow
/etc/group
SEE ALSO
passwd(1), users(1), groupadd(1M), groupdel(1M), groupmod(1M),
logins(1M), useradd(1M), userdel(1M), group(4), passwd(4), shadow(4).
Page 3 Reliant UNIX 5.44 Printed 11/98