usermod.1m (2010 09)
u
usermod(1M) usermod(1M)
-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
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 follow-
ing:
July 13, 1993
7/13/93
A value of ’’ (two single quotes) or
"" (two double quotes) results in no expira-
tion date.
-p encrypted_password
Specify the encrypted password for the user. Before using the
-p option, obtain
the encrypted password by using
crypt() or
crypt2() (see crypt (3C) or
crypt2 (3C)).
-F Force the changes, even if the login is currently in use.
-P Indicate that modifications are to be made to the alternate password file of NIS
specified by the -S option. The following options edit the password file and
should not be used with the -P option:
-m, -i, -r, -k, -F.
-S alternate_password_file
Specify the path of the alternate password file of NIS. The -P option is used
with the -S option.
The
-e and -f options are supported only if Shadow Passwords are in use. For details refer to
pwconv (1M).
In the event where a directory is shared by users of the same group and the owner of that directory is
modified, then the ownership of that directory is propagated to the next user who is sharing that direc-
tory. The new owner is determined by looking at the order in which the users sharing this directory are
added to the
/etc/passwd file. If there is only one user remaining then the directory is brought back
to unshared mode by resetting the permissions to 755 from 775.
If a directory is shared by users, then one cannot change the primary group of any of these users unless
the home directory of that user is also changed.
NIS
The
usermod command is aware of NIS user and group entries. Only local users and groups may be
modified with this command. Attempts to modify an NIS user or group will result in an error. NIS users
and groups must be administered from the NIS server. NIS users are checked when verifying the unique-
ness of the new UID or new user name, which may result in the following error messages:
login x does not exist
(return value 6) if the user specified is an NIS user (see passwd (4)). Also, the error
Cannot modify /etc/group file, /etc/passwd was modified
(return value 10) is returned if an NIS group is specified with either the -g option or the -G option (see
group(4)).
NFS
Errors may occur with the
-m option if either the source or the target directory is within an NFS mounted
file system that does not allow root privileges across the NFS mount, and the directory or files within the
directory do not have sufficient permissions.
RETURN VALUE
usermod exits with one of the following values:
0 Successful completion.
2 Invalid command syntax.
3 Invalid argument supplied to an option.
4 uid is not unique (when -o is not used).
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010