HP-UX Reference (11i v3 07/02) - 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 [
-i]]] [-s shell]
[
-c comment][-f inactive][
-l new_logname][-e expire]
[
-p encrypted_password][
-F][
-P -S alternate_password_file] 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 the 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 Specify the UID for the user. uid must be a non-negative decimal integer less than
MAXUID as it is defined in the <param.h> header file.
-o Allow the UID to be non-unique (that is, a duplicate).
-g group Specify the integer group ID or character string name of an existing group. This
redefines the primary group membership of the login.
-G group Specify the integer group ID or character string name of an existing group. This
redefines the supplemental group memberships of the login. Duplicates within
group with the -g and -G options are ignored.
-d dir Specify the new home directory of the login. It defaults to base_dir/login, where
login is the 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. The
operation cannot be performed if the user’s home directory is the root directory or
if the user’s home directory is specified in the
/etc/default/usermod
configuration file. See usermod(4). If the home directory exists, the directory
must have read and execute permission by group, where group is the primary
group of the login. This condition can be overridden using the -i option.
-i Inherit an existing home directory, regardless of its current access permissions.
Typically use this option to inherit orphaned directories, that is, directories that
are not owned by any active user of the system. Note that using the -i option will
impact shared home directories; hence use the
-i option with caution. The per-
missions will be same as that of newly created home directory.
-s shell Specify the full pathname of the login shell. The value of shell must be a valid exe-
cutable file.
-c comment Specify the comment field present in the /etc/passwd entry of this login. This
can be any text string. A short description of the login is suggested for this field.
-f inactive Specify the maximum number of days of continuous inactivity of the login before
the account is locked. For the valid values of inactive refer to description of inac-
tivity field in shadow(4).
-l new_logname Specify the new login name for the user. It consists of a string of printable charac-
ters that does not contain a colon (:) or a newline (\n).
-e expire Specify the date on which this login can no longer be used. After the expire date
occurs, no user will be able to access this login. This option is used to create tem-
porary 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:
592 Hewlett-Packard Company 1 HP-UX 11i Version 3: February 2007