Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
useradd(8) OSS Shell and Utilities Reference Manual
NAME
useradd - Creates a new user or alias, or updates default new user or alias information.
SYNOPSIS
useradd [OPTION] LOGIN
useradd -A ALIAS_NAME [OPTION][LOGIN]
useradd -D
useradd -D [OPTION]
FLAGS
The following flags are only valid on systems running Safeguard. If these flags are used on a sys-
tem not running Safeguard, a diagnostic message is reported on STDERR and the command exits
with the exit status of 15.
-A ALIAS_NAME
Add user alias with name ALIAS_NAME.
-c COMMENT
Any text string of maximum length of 80 characters. It is generally a short description of
the login, and is currently used as the field for the user’s full name.
-d HOME_DIR
The new user is created using HOME_DIR as the value for the user’s login directory. The
default is to append the LOGIN name (in the form ’groupName.memberName’, specified or
derived) to BASE_DIR and use that as the login directory name. The directory HOME_DIR
need not exist, but is not created if it is missing.
-e EXPIRE_DATE
The date on which the user account will expire. The date is specified in the format
"YYYY-MM-DD". If not specified, useradd uses the default expiry date specified by the
EXPIRE variable in /etc/default/users, or an empty string (no expiry) by default.
-f INACTIVE
The number of days after a password expires until the account is expired. This value ranges
from 0 through 32767. A value of 0 disables the account as soon as the password has
expired. If not specified, useradd uses the default inactivity period specified by the INAC-
TIVE variable in the /etc/default/users file, or none. If none, the PASSWORD-EXPIRY-
GRACE attribute specified in the Safeguard configuration record is used.
-k SKEL_DIR
The skeleton directory, which contains files and directories to be copied in the user’s home
directory, when the home directory is created by useradd. This option is only valid if the
-m option is specified. If this option is not set, the skeleton directory is defined by the SKEL
variable in /etc/default/users or, by default, /etc/skel.
-K KEY=VALUE
Overrides /etc/login.defs defaults (UMASK, PASS_MAX_DAYS and others). Example:
-K UMASK=023 can be used to specify the umask value. You can specify multiple -K
options. For example: -K UMASK=023 -K PASS_MAX_DAYS=90.
-m Create the user’s home directory if it does not exist. The files and directories contained in
the skeleton directory (which can be defined with the -k option) are copied to the home
directory. By default, no home directories are created.
-M Do not create the user’s home directory, even if the system wide setting from /etc/login.defs
(CREATE_HOME) is set to yes.
-p PASSWORD
The login password. By default the value is set to null (no password is required to log on).
The following flags are always valid.
12−72 Hewlett-Packard Company 527188-021