useradd.1m (2010 09)

u
useradd(1M) useradd(1M)
The useradd login command defines the new login name, specified as a string of printable characters.
login can not contain a colon (
:) or a newline (\n).
The
-e and -f options are supported only if
Shadow Passwords are in use. For details refer to
pwconv (1M).
NIS
The
useradd command is aware of NIS user and group entries. Only local users and groups may be
modified with the useradd 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 following error messages:
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 an NIS group is specified with either the
-g option or the -G option (see
group(4)).
NFS
Errors may occur with the
-m or -k options if the indicated directory is within an NFS mounted file sys-
tem that does not allow root privileges across the NFS mount, and the directory or files within the direc-
tory do not have sufficient permissions.
RETURN VALUE
useradd 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 group specified with the -g option does not exist.
9 login is not unique.
10 Cannot modify the /etc/group file. The login was added to the /etc/passwd file, but not
to the /etc/group file.
12 Unable to create the home directory (while using the -m option) or unable to complete the copy
of skel_dir to the new home directory.
13 Unable to open /etc/ptmp file or /etc/default file, or /etc/passwd file is non-
existent.
14 /etc/passwd,or/etc/ptmp,or/etc/default file busy. Another command may be
modifying the /etc/passwd file.
16 Cannot add the entry into the /etc/passwd file.
18 Out of memory.
19 Invalid template file.
54 Exceeding permissible limit of maximum members in a group. The /etc/group file is not
modified.
55 Cannot modify the specified template.
56 The file is either missing or not in a sane state.
EXAMPLES
Add the user
otto to the system with all of the default attributes.
useradd otto
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3