| United States-English |
|
|
|
![]() |
HP-UX Reference > uuseradd(1M)HP-UX 11i Version 1.6: June 2002 |
|
NAMEuseradd — add a new user login to the system SYNOPSISuseradd [-u uid [-o] ] [-g group] [-G group [, group...]] [-d dir] [-s shell] [-c comment] [-m [-k skel_dir]] [-f inactive] [-e expire] login useradd -D [-g group] [-b base_dir] [-f inactive] [-e expire] DESCRIPTIONThe useradd command creates a user login on the system by adding the appropriate entry to the /etc/passwd file and any security files, modifying the /etc/group file as necessary, creating a home directory, and copying the appropriate default files into the home directory depending on the command line options. The new login remains locked until the passwd (see passwd(1)) command is invoked. New Behaviorlogin will not be added to the primary group entry in the /etc/group file, even if the primary group is specified in the command line. However, the login is added to the corresponding supplemental group in /etc/group file. OptionsThe useradd command supports the following options:
The useradd command may be used with the login argument, where login is the new login name, specified as a string of printable characters. It may not contain a colon (:) or a newline (\n). Unless enhanced security is installed (see pwconv(1M)), the -e and -f options are not supported and will return an error. NISThis 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 uniqueness of the new UID or new user name, which may result in the error login x not unique (return value 9), or the error UID # is not unique (when -o is not used) (return value 4) even though the user or UID is not present in the local /etc/passwd file. The error Cannot modify /etc/group file, /etc/passwd was modified (return value 10) is returned if a group specified with either the -g option or the -G option is an NIS group (see group(4)). RETURN VALUEuseradd exits with one of the following values:
EXAMPLESAdd the user otto to the system with all of the default attributes. useradd otto Add the user otto to the system with a UID of 222 and a primary group of staff. useradd -u 222 -g staff otto List the defaults for the primary group, base directory, inactivity timeout, and skeleton directory. useradd -D Change the default primary group to staff. useradd -D -g staff WARNINGSA directory can be shared between the users belonging to the same group. If the home directory is in the unshared mode and a new user is allocated to that directory then it will be put into the 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. Otherwise, useradd will report an error. Any existing directory in the system can be allocated to a new user. If this directory is not the home directory of an existing user AND has read and execute permissions for the group, its ownership will be recursively changed to the new user. As many users may try to write the /etc/passwd file simultaneously, a passwd locking mechanism was deviced. If this locking fails after subsequent retrying, useradd terminates. A group entry in the /etc/group file can have maximum of LINE_MAX bytes. If a user is added to a group that has reached LINE_MAX limit, another entry of the same group is created to which the new user is added. A warning message is also issued. SEE ALSOpasswd(1), users(1), groupadd(1M), groupdel(1M), groupmod(1M), logins(1M), userdel(1M), usermod(1M), group(4). |
||||||||||||||||||||||||||||
|
|||||||||||||||