HP-UX Reference (11i v2 03/08) - 1M System Administration Commands N-Z (vol 4)
u
useradd(1M) useradd(1M)
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.
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.
useradd -D -g staff
WARNINGS
A 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.
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.
FILES
/etc/shadow Shadow Password file
/etc/passwd System Password file
/etc/skel Skeleton directory
/etc/group System group file
/etc/ptmp Lock file used when updating password file
SEE ALSO
passwd(1), users(1), groupadd(1M), groupdel(1M), groupmod(1M), logins(1M), userdel(1M), usermod(1M),
pwconv(1M), group(4), shadow(4).
STANDARDS CONFORMANCE
useradd: SVID3
Section 1M−−826 Hewlett-Packard Company − 3 − HP-UX 11i Version 2: August 2003