HP-UX Reference (11i v3 07/02) - 1M System Administration Commands N-Z (vol 4)
u
useradd(1M) useradd(1M)
-f inactive Specify the maximum number of days of continuous inactivity of the login before the
account is locked. For the valid values of inactive refer to description of inactivity field
in shadow(4).
-e expire Specify the date on which this account is no longer valid. After the expire date occurs,
no user will be able to access this account. 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 ’’ (two single quotes) or
"" (two double quotes) results in no expiration
date.
-p encrypted_password
Specify the initial encrypted password for the user. Before using the
-p option,
obtain the encrypted password by using
crypt() (see crypt(3C)).
-P Specify that the changes are being made to the alternate password file of NIS
specified by the -S option. The following options edit the password file and should not
be used with the -P option:
-m, -i, -r, -k, -D.
-S alternate_password_file
Specify the path of the alternate password file of NIS. The -P option is used with the
-S option.
-D Manage 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, comment,
update_homedir_ownership, create_homedir, and allow_dup_uids are displayed.
Invoking
useradd with this option and other allowed options sets the default values
for those options listed in SYNOPSIS.
-t template Specify the template to be used when loading the defaults for options not specified for
useradd command. Any file of the form /etc/default/useradd
, can be
specified as a template file. When used with
-D, the specified attributes are updated
to the template file.
-b base_dir Specify the default base directory for the system. If -d dir is not specified, base_dir is
concatenated with the new login name (login) to define the path of the new home
directory.
-O allow_dup_uids
Specify whether duplicate UIDs should be allowed by default. The value for
allow_dup_uids is either
yes or no:
yes Allow usage of duplicate UIDs by default.
no Disallow usage of duplicate UIDs by default.
-r update_homedir_ownership
By default, useradd will not recursively update the ownership of the home directory
for the new user if the directory exists and is not a shared home directory. This
behavior of useradd can be changed using the -r [yes|no] option. When used
with the -D option, the -r option will set the default behavior. The
update_homedir_ownership argument is either 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 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).
582 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: February 2007