HP-UX Reference (11i v2 04/09) - 1M System Administration Commands N-Z (vol 4)
u
useradd(1M) useradd(1M)
-e expire Specifies the date on which this login can no longer be used. After expire , no user
will be able to access this login. This option is used to create temporary logins.
expire , which is a date, may be typed in any format, except a Julian date. For
example, a date may be entered in either of the following formats:
July 13, 1993
7/13/93
A value of ’’’’ defeats the expired date status.
-D Manages the defaults for various options. When
useradd is invoked with this
option only, the default values for group , base_dir , skel_dir , shell , inactive , expire ,
and update_homedir_ownership are displayed. Invoking
useradd with this option
and other allowed options sets the default values for those options.
-b base_dir Specifies the default base directory for the system. If
-d dir is not specified,
base_dir is concatenated with the new login name to define the path of the new
home directory. base_dir must exist.
-r update_homedir_ownership
By default, useradd will not recursively update the ownership of the home direc-
tory for the new user if the directory exists and is not a shared home directory.
This behavior of useradd can be changed using -r [yes|no] option. When used
with the -D option it will set the default behavior. This option takes the argument
yes or no:
yes useradd will recursively update the ownership of the home directory and
the files/directories below it to the new user, if the directory already exists
and is not a shared home directory.
no useradd will not update the ownership of the home directory and the
files/directories below it.
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, the
-e and -f options are not supported and will return an error.
Networking Features
NIS
This 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)).
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.
HP-UX 11i Version 2: September 2004 − 2 − Hewlett-Packard Company Section 1M−−843