useradd.1m (2010 09)
u
useradd(1M) useradd(1M)
-k skel_dir Specify the skeleton directory that contains information that can be copied to the
new login’s home directory. This skeleton directory must exist. The system pro-
vides a skeleton directory, /etc/skel, that can be used for this purpose.
-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 tem-
porary 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() or
crypt2() (see crypt (3C) or
crypt2 (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. It is recommended to use -D and -t and at least one
other allowed option listed in the SYNOPSIS to create the template.
-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 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 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.
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010