|
|
HP-UX Reference Volume 2 of 5 > uusermod(1M) |
|
NAMEusermod — modify a user login on the system SYNOPSISusermod [-u uid [-o] ] [-g group] [-G group [, group...]] [-d dir [-m] ] [-s shell] [-c comment] [-f inactive] [-l new_logname] [-e expire] login DESCRIPTIONThe 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 a new login name, specified as a string of printable characters. It may not contain a colon (:) or a newline (\n). New BehaviorIf 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. OptionsThe usermod command supports the following options:
Unless enhanced security is installed (see pwconv(1M)), the -e and -f options are not supported and will return an error. 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. NISThe 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)). RETURN VALUEusermod exits with one of the following values:
EXAMPLESChange 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 WARNINGSAs many users may try to write the /etc/passwd file simultaneously, a passwd locking mechanism was devised. If this locking fails after subsequent retrying, usermod terminates. While modifying the user login, the username is not added to the primary group entry in the /etc/group file. If a supplemental group is specified, the user is added to the supplemental group. If the size of a group entry in /etc/group file exceeds LINE_MAX limit, a new entry of the same group is created and a warning message is issued. SEE ALSOpasswd(1), users(1), groupadd(1M), groupdel(1M), groupmod(1M), logins(1M), useradd(1M), userdel(1M), group(4). |
|