1 .\" ** You probably do not want to edit this file directly **
2 .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
3 .\" Instead of manually editing it, you probably should edit the DocBook XML
4 .\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
5 .TH "USERADD" "8" "01/02/2006" "System Management Commands" "System Management Commands"
6 .\" disable hyphenation
8 .\" disable justification (adjust text to left margin only)
11 useradd \- Create a new user or update default new user information
14 \fBuseradd\fR [\fIoptions\fR] \fILOGIN\fR
18 \fBuseradd\fR \-D [\fIoptions\fR]
21 When invoked without the
25 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 will update system files and may also create the new user's home directory and copy initial files.
28 The options which apply to the
32 \fB\-c\fR, \fB\-\-comment\fR \fICOMMENT\fR
33 Any text string. It is generally a short description of the login, and is currently used as the field for the user's full name.
35 \fB\-b\fR, \fB\-\-base\-dir\fR \fIBASE_DIR\fR
36 The default base directory for the system if
40 is concatenated with the account name to define the home directory. If the
42 option is not used, base_dir must exist.
44 \fB\-d\fR, \fB\-\-home\fR \fIHOME_DIR\fR
45 The new user will be created using
47 as the value for the user's login directory. The default is to append the
51 and use that as the login directory name.
53 \fB\-e\fR, \fB\-\-expiredate\fR \fIEXPIRE_DATE\fR
54 The date on which the user account will be disabled. The date is specified in the format
57 \fB\-f\fR, \fB\-\-inactive\fR \fIINACTIVE\fR
58 The number of days after a password expires until the account is permanently disabled. A value of 0 disables the account as soon as the password has expired, and a value of \-1 disables the feature. The default value is \-1.
60 \fB\-g\fR, \fB\-\-gid\fR \fIGROUP\fR
61 The group name or number of the user's initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is 1 or whatever is specified in
62 \fI/etc/default/useradd\fR.
64 \fB\-G\fR, \fB\-\-groups\fR \fIGROUP1\fR[\fI,GROUP2,...\fR[\fI,GROUPN\fR]]]
65 A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the
67 option. The default is for the user to belong only to the initial group.
69 \fB\-h\fR, \fB\-\-help\fR
70 Display help message and exit.
72 \fB\-m\fR, \fB\-\-create\-home\fR
73 The user's home directory will be created if it does not exist. The files contained in
75 will be copied to the home directory if the
77 option is used, otherwise the files contained in
79 will be used instead. Any directories contained in
83 will be created in the user's home directory as well. The
85 option is only valid in conjunction with the
87 option. The default is to not create the directory and to not copy any files.
89 \fB\-K\fR, \fB\-\-key\fR \fIKEY\fR=\fIVALUE\fR
90 Overrides /etc/login.defs defaults (UID_MIN, UID_MAX, UMASK, PASS_MAX_DAYS and others).
93 \fB\-K \fR\fIPASS_MAX_DAYS\fR=\fI\-1\fR
94 can be used when creating system account to turn off password ageing, even though system account has no password at all. Multiple
96 options can be specified, e.g.:
97 \fB\-K \fR\fIUID_MIN\fR=\fI100\fR\fB \-K \fR\fIUID_MAX\fR=\fI499\fR
100 \fB\-K \fR\fIUID_MIN\fR=\fI10\fR,\fIUID_MAX\fR=\fI499\fR
103 \fB\-o\fR, \fB\-\-non\-unique\fR
104 Allow create user account with duplicate (non\-unique) UID.
106 \fB\-p\fR, \fB\-\-password\fR \fIPASSWORD\fR
107 The encrypted password, as returned by
108 \fBcrypt\fR(3). The default is to disable the account.
110 \fB\-s\fR, \fB\-\-shell\fR \fISHELL\fR
111 The name of the user's login shell. The default is to leave this field blank, which causes the system to select the default login shell.
113 \fB\-u\fR, \fB\-\-uid\fR \fIUID\fR
114 The numerical value of the user's ID. This value must be unique, unless the
116 option is used. The value must be non\-negative. The default is to use the smallest ID value greater than 999 and greater than every other user. Values between 0 and 999 are typically reserved for system accounts.
117 .SS "Changing the default values"
119 When invoked with the
123 will either display the current default values, or update the default values from the command line. The valid options are
125 \fB\-b\fR \fIHOME_DIR\fR
126 The initial path prefix for a new user's home directory. The user's name will be affixed to the end of
128 to create the new directory name if the
130 option is not used when creating a new account.
132 \fB\-e\fR \fIEXPIRE_DATE\fR
133 The date on which the user account is disabled.
135 \fB\-f\fR \fIINACTIVE\fR
136 The number of days after a password has expired before the account will be disabled.
138 \fB\-g\fR, \fB\-\-gid\fR \fIGROUP\fR
139 The group name or ID for a new user's initial group. The named group must exist, and a numerical group ID must have an existing entry.
141 \fB\-s\fR, \fB\-\-shell\fR \fISHELL\fR
142 The name of the new user's login shell. The named program will be used for all future new user accounts.
144 If no options are specified,
146 displays the current default values.
149 The system administrator is responsible for placing the default user files in the
154 You may not add a user to a NIS group. This must be performed on the NIS server.
156 Similarly, if the username already exists in an external user database such as NIS,
158 will deny the user account creation request.
160 Usernames must begin with a lower case letter or an underscore, and only lower case letters, underscores, dashes, and dollar signs may follow. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]
164 user account information
167 secure user account information
170 group account information
172 \fI/etc/default/useradd\fR
176 directory containing default files
178 \fI/etc/login.defs\fR
179 shadow password suite configuration
184 command exits with the following values:
190 can't update password file
193 invalid command syntax
196 invalid argument to option
199 UID already in use (and no
203 specified group doesn't exist
206 username already in use
209 can't update group file
212 can't create home directory
215 can't create mail spool