Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
Administrator Commands and Files useradd(8)
-b BASE_DIR
The default base directory for the system if -d HOME_DIR is not specified. BASE_DIR is
concatenated with the account name, that is, ’groupName.memberName’ to define the home
directory. If the -m option is not used, BASE_DIR must exist. If this option is not specified,
useradd uses the base directory specified by the HOME variable in /etc/default/users,or
/home by default. If Safeguard is not running on the system, this option is not applicable.
In these cases, a diagnostic message is reported on STDERR and the command exits with
the exit status of 15.
-D Print or change default useradd configuration. See the "Changing the default values" sub-
section.
-h Display this help and exit.
DESCRIPTION
When invoked without the -D option, the useradd command creates a new user account using the
values specified on the command line and the default values from the system. Depending on
command-line options, the useradd command updates system files and might also create the new
user’s home directory and copy initial files.
You can specify the LOGIN name in a fully qualified form
’groupName.memberName:groupNum,memberNum’ (no white spaces); or a partial name contain-
ing only the memberName. When a partial name is used, the group name and corresponding group
number will be taken from the GROUP variable in the /etc/default/users file. memberNum will be
the first unused number starting from 254 in the descending order, in the range of 254 - 0. member-
Num 255 is reserved for SUPER memberName.
In the useradd -A alias [OPTION] [LOGIN] form, a user alias is added. The LOGIN in this case,
specified or derived as described previously, must be an existing user. If [LOGIN] is not specified,
the USER variable in the /etc/default/users file is used.
Changing the Default Values
When invoked with only the -D option, useradd displays the current default values. When
invoked with -D plus other options, useradd will update the default values for the specified
options. Valid default-changing options are:
-b BASE_DIR
The path prefix for a new user’s home directory. If the -d option is not used when creating a
new account, the user’s name is affixed to the end of BASE_DIR to form the new user’s
home directory name. This option sets the HOME variable in /etc/default/users.
-e EXPIRE_DATE
The date on which the user account will expire. This option sets the EXPIRE variable in
/etc/default/users.
Only valid on systems running Safeguard.
-f INACTIVE
The number of days after a password has expired before the account expires. This option
sets the INACTIVE variable in /etc/default/users.
Only valid on systems running Safeguard.
NOTES
• You can only use partial LOGIN when the Safeguard subsystem is run-
ning.
• The -p option is not recommended because the password will be visible
by users listing the processes.
527188-021 Hewlett-Packard Company 12−73