HP-UX Reference (11i v2 03/08) - 1M System Administration Commands N-Z (vol 4)

u
usermod(1M) usermod(1M)
Also, the directory which will be shared should have read and execute permissions for the group.
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.
Networking Features
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. This command may fail with the error
login x does not exist
(return value 6) if the user specified is an NIS user (see passwd(4)). However, NIS users are checked
when verifying uniqueness of the new UID or the new user name. Also, the error
Cannot modify /etc/group file, /etc/passwd was modified
(return value 10) may be returned if a group specified with either the -g option or the
-G option is an
NIS group (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).
6 The login to be modified or the group specified with the
-g option does not exist.
8 The login to be modified is in use.
9 new_logname is not unique.
10 Cannot modify the /etc/group file. The other parts of the update request will be per-
formed.
11 There is insufficient space to move the home directory (with the -m option). The other parts of
the update request will be performed.
12 Unable to complete the move of the home directory to the new home directory.
13 Unable to open /etc/ptmp file, or /etc/passwd file is non-existent.
14 /etc/passwd file or /etc/ptmp file busy. Another command may be modifying the
/etc/passwd file.
15 Cannot modify the entry in the /etc/passwd file.
EXAMPLES
Change
otto’s primary group to staff.
usermod -g staff otto
Change otto’s user ID to 333 and change the login name to bob.
usermod -u 333 -l bob otto
Section 1M830 Hewlett-Packard Company 2 HP-UX 11i Version 2: August 2003