HP-UX Reference (11i v2 07/12) - 1M System Administration Commands N-Z (vol 4)
u
usermod(1M) usermod(1M)
NAME
usermod - modify a user login on the system
SYNOPSIS
usermod [-u uid [-o]][
-g group][-G group [, group ... ]] [-d
dir [-m]][-s shell]
[
-c comment][-f inactive][
-l new_logname][-e expire] login
DESCRIPTION
The
usermod command modifies a user login on the system by changing the appropriate login related
files.
The usermod command requires the login argument. login is a new login name, specified as a string of
printable characters. It may not contain a colon (
:) or a newline (\n).
New Behavior
If the primary group of a user is modified, then the user name is not added to the primary group entry in
/etc/group file. However, if -G option is specified the user is added to the corresponding supplemental
group.
Options
The usermod command supports the following options:
-u uid Specifies the UID for the new user. uid must be a non-negative decimal integer
less than MAXUID as it is defined in the <param.h> header file.
-o Allows the UID to be non-unique (i.e., a duplicate).
-g group Specifies the integer group ID or character string name of an existing group.
This redefines the primary group membership of the new login.
-G group Specifies the integer group ID or character string name of an existing group.
This redefines the supplemental group memberships of the new login. Dupli-
cates within group with the -g and -G options are ignored.
-d dir Specifies the new home directory of the login. It defaults to base_dir/login,
where login is the new login and base_dir is the base directory for new login
home directories.
-m Move the user’s home directory to the directory specified with the
-d option. If
the home directory exists, the directory must have read and execute permission
by group, where group is the primary group of the login. When the Restricted
Movement of Home Directories feature is installed, this operation cannot be per-
formed if the user’s home directory is the root directory or is specified in the
/etc/default/usermod
configuration file. Refer to usermod(4) for the for-
mat of the
/etc/default/usermod
configuration file.
-s shell Specifies the full path name of the login shell. The value of shell must be a valid
executable file.
-c comment Specifies the comment field present in the /etc/passwd entry of this login.
This can be any text string. A short description of the new login is suggested for
this field.
-f inactive Specifies the maximum number of days of continuous inactivity of the login
before the login is declared invalid. Normal values are positive integers, while a
value of −1 defeats this status. This option is supported on trusted system and
also on shadow password systems if the TrustedMigration product is installed.
-l new_logname Specifies the new login name for the user. It consists of a string of printable
characters that does not contain a colon (:) or a newline (\n). If the TrustedMi-
gration product is installed, the login name is updated in the user database.
-e expire Specifies the date on which this login can no longer be used. After expire,no
user will be able to access this login. This option is used to create temporary
logins. expire, which is a date, may be typed in any desired format, except a
Julian date. For example, a date may be entered as either of the following:
July 13, 1993
7/13/93
HP-UX 11i Version 2: December 2007 Update − 1 − Hewlett-Packard Company 581