usermod.1m (2010 09)

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).
Refer to usergroupname(5) to understand the functionality changes with the Numeric User Group Name
feature.
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 supplemen-
tal 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 direc-
tories.
-m Move the users home directory to the directory specified with the
-d option.
The operation cannot be performed if the user’s home directory is the root direc-
tory or if the users 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
permissions 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
executable 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 char-
acters that does not contain a colon (:) or a newline (\n).
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)