HP-UX Reference (11i v3 07/02) - 1M System Administration Commands N-Z (vol 4)

u
useradd(1M) useradd(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 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
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 le is not
modified.
EXAMPLES
Add 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.
HP-UX 11i Version 3: February 2007 3 Hewlett-Packard Company 583