HP-UX Reference (11i v1 00/12) - 1M System Administration Commands N-Z (vol 4)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1m/naaagt.1m
________________________________________________________________
___ ___
u
usermod(1M) usermod(1M)
A directory can be shared between the users belonging to the same group. If the home directory is in
unshared mode and a new user is allocated to that directory, then it will be put into shared mode by setting
the permissions of that directory to 775 (i.e., includes the write permissions to the group as well). 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 directory.
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 performed.
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.
Section 1M−−988 − 2 − HP-UX Release 11i: December 2000
___
___