Manual page for usermod(1M)
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 new_logname
]
[
-f inactive
] [
-e expire
]
login
AVAILABILITY
SUNWcsu
DESCRIPTION
usermod
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.
login
is 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).
OPTIONS
- -u uid
-
Specify a new
UID
for the user.
It must be a non-negative decimal integer less than
MAXUID
as defined in
<param.h>.
Note that
the
UID
associated with the user's home directory is not
modified with this option;
a user will not have access to their home directory
until the
UID
is manually reassigned using
chown.1m
- -o
-
This option allows the specified
UID
to be duplicated (non-unique).
- -g group
-
Specify an existing group's integer
ID
or character-string name.
It redefines the user's primary group membership.
- -G group
-
Specify 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
NGROUPS_UMAX
groups may be specified as defined in
<param.h>.
- -d dir
-
Specify the new home directory of the user.
It defaults to
base_dir/login,
where
base_dir
is the base directory for new login home directories,
and
login
is the new login.
- -m
-
Move 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 by
group,
where
group
is the user's primary group.
- -s shell
-
Specify the full pathname of the program that is used as the user's
shell on login.
The value of
shell
must be a valid executable file.
- -c comment
-
Specify a comment string.
comment
can be 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 new_logname
-
Specify 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
-
Specify the future 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
-
Specify 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.
EXIT CODES
In case of an error,
usermod
prints an error message and
exits with one of the following values:
- 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.
- 5
-
The password files contain an error.
pwconv.1m
can be used to correct possible errors.
See
passwd.4
- 6
-
The login to be modified does not exist, the
group
does not exist, or the login shell does not exist.
- 8
-
The login to be modified is in use.
- 9
-
The
new_logname
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.
FILES
- /etc/passwd
-
system password file
- /etc/shadow
-
system file containing users' encrypted passwords and related information
- /etc/group
-
system file containing group definitions
SEE ALSO
passwd.1
users.1b
chown.1m
groupadd.1m
groupdel.1m
groupmod.1m
logins.1m
pwconv.1m
useradd.1m
userdel.1m
passwd.4
NOTES
usermod
only modifies passwd definitions in the local
/etc/passwd
and
/etc/shadow
files.
If a network nameservice such as
NIS
or
NIS+
is being used to supplement the local
files with additional entries,
usermod
cannot change information supplied by the network nameservice.
However
usermod
will verify the uniqueness of user name and user
ID
against the
external nameservice.
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97