3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
6 .\" Manual: Systemhanteringskommandon
7 .\" Source: Systemhanteringskommandon
10 .TH "USERADD" "8" "16-02-2011" "Systemhanteringskommandon" "Systemhanteringskommandon"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 useradd \- skapa en ny anv\(:andare eller uppdatera standardinformation f\(:or nya anv\(:andare
33 .HP \w'\fBuseradd\fR\ 'u
34 \fBuseradd\fR [\fIflaggor\fR] \fIINLOGGNINGSNAMN\fR
35 .HP \w'\fBuseradd\fR\ 'u
37 .HP \w'\fBuseradd\fR\ 'u
38 \fBuseradd\fR \-D [\fIflaggor\fR]
41 When invoked without the
45 command creates a new user account using the values specified on the command line plus the default values from the system\&. Depending on command line options, the
47 command will update system files and may also create the new user\*(Aqs home directory and copy initial files\&.
49 By default, a group will also be created for the new user (see
53 \fBUSERGROUPS_ENAB\fR)\&.
56 Flaggorna som g\(:aller f\(:or kommandot
60 \fB\-b\fR, \fB\-\-base\-dir\fR \fIBASE_DIR\fR
62 The default base directory for the system if
67 is concatenated with the account name to define the home directory\&. If the
73 If this option is not specified,
75 will use the base directory specified by the
78 /etc/default/useradd, or
83 \fB\-c\fR, \fB\-\-comment\fR\fIKOMMENTAR\fR
85 Any text string\&. It is generally a short description of the login, and is currently used as the field for the user\*(Aqs full name\&.
88 \fB\-d\fR, \fB\-\-home\fR\fIHEM_KAT\fR
90 The new user will be created using
92 as the value for the user\*(Aqs login directory\&. The default is to append the
96 and use that as the login directory name\&. The directory
98 does not have to exist but will not be created if it is missing\&.
101 \fB\-D\fR, \fB\-\-defaults\fR
103 See below, the subsection "Changing the default values"\&.
106 \fB\-e\fR, \fB\-\-expiredate\fR\fIUTG\(oANGSDATUM\fR
108 The date on which the user account will be disabled\&. The date is specified in the format
109 \fIYYYY\-MM\-DD\fR\&.
113 will use the default expiry date specified by the
116 /etc/default/useradd, or an empty string (no expiry) by default\&.
119 \fB\-f\fR, \fB\-\-inactive\fR\fIINAKTIV\fR
121 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\&.
125 will use the default inactivity period specified by the
128 /etc/default/useradd, or \-1 by default\&.
131 \fB\-g\fR, \fB\-\-gid\fR\fIGRUPP\fR
133 The group name or number of the user\*(Aqs initial login group\&. The group name must exist\&. A group number must refer to an already existing group\&.
135 If not specified, the bahavior of
138 \fBUSERGROUPS_ENAB\fR
140 /etc/login\&.defs\&. If this variable is set to
143 \fB\-U/\-\-user\-group\fR
144 is specified on the command line), a group will be created for the user, with the same name as her loginname\&. If the variable is set to
147 \fB\-N/\-\-no\-user\-group\fR
148 is specified on the command line), useradd will set the primary group of the new user to the value specified by the
151 /etc/default/useradd, or 100 by default\&.
154 \fB\-G\fR, \fB\-\-groups\fR\fIGRUPP1\fR[\fI,GRUPP2,\&.\&.\&.\fR[\fI,GRUPPN\fR]]]
156 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
158 option\&. The default is for the user to belong only to the initial group\&.
161 \fB\-h\fR, \fB\-\-help\fR
163 Visa hj\(:alpmeddelande och avsluta\&.
166 \fB\-k\fR, \fB\-\-skel\fR \fISKEL_DIR\fR
168 The skeleton directory, which contains files and directories to be copied in the user\*(Aqs home directory, when the home directory is created by
171 This option is only valid if the
174 \fB\-\-create\-home\fR) option is specified\&.
176 If this option is not set, the skeleton directory is defined by the
184 \fB\-K\fR, \fB\-\-key\fR\fINYCKEL\fR=\fIV\(:ARDE\fR
188 defaults (\fBUID_MIN\fR,
195 \fB\-K \fR\fIPASS_MAX_DAYS\fR=\fI\-1\fR
196 can be used when creating system account to turn off password ageing, even though system account has no password at all\&. Multiple
198 options can be specified, e\&.g\&.:
200 \fIUID_MIN\fR=\fI100\fR
202 \fIUID_MAX\fR=\fI499\fR
205 \fB\-K \fR\fIUID_MIN\fR=\fI10\fR,\fIUID_MAX\fR=\fI499\fR
206 fungerar \(:annu inte\&.
209 \fB\-l\fR, \fB\-\-no\-log\-init\fR
211 Do not add the user to the lastlog and faillog databases\&.
213 By default, the user\*(Aqs entries in the lastlog and faillog databases are resetted to avoid reusing the entry from a previously deleted user\&.
216 \fB\-m\fR, \fB\-\-create\-home\fR
218 Create the user\*(Aqs home directory if it does not exist\&. The files and directories contained in the skeleton directory (which can be defined with the
220 option) will be copied to the home directory\&.
222 By default, no home directories are created\&.
227 Do no create the user\*(Aqs home directory, even if the system wide setting from
229 (\fBCREATE_HOME\fR) is set to
233 \fB\-N\fR, \fB\-\-no\-user\-group\fR
235 Do not create a group with the same name as the user, but add the user to the group specified by the
240 /etc/default/useradd\&.
242 The default behavior (if the
246 options are not specified) is defined by the
247 \fBUSERGROUPS_ENAB\fR
252 \fB\-o\fR, \fB\-\-non\-unique\fR
254 Allow the creation of a user account with a duplicate (non\-unique) UID\&.
256 This option is only valid in combination with the
261 \fB\-p\fR, \fB\-\-password\fR\fIL\(:OSENORD\fR
263 The encrypted password, as returned by
264 \fBcrypt\fR(3)\&. The default is to disable the password\&.
268 This option is not recommended because the password (or encrypted password) will be visible by users listing the processes\&.
270 You should make sure the password respects the system\*(Aqs password policy\&.
273 \fB\-r\fR, \fB\-\-system\fR
275 Create a system account\&.
277 System users will be created with no aging information in
278 /etc/shadow, and their numeric identifiers are choosen in the
279 \fBSYS_UID_MIN\fR\-\fBSYS_UID_MAX\fR
281 /etc/login\&.defs, instead of
282 \fBUID_MIN\fR\-\fBUID_MAX\fR
285 counterparts for the creation of groups)\&.
289 will not create a home directory for such an user, regardless of the default setting in
291 (\fBCREATE_HOME\fR)\&. You have to specify the
293 options if you want a home directory for a system account to be created\&.
296 \fB\-s\fR, \fB\-\-shell\fR\fISKAL\fR
298 The name of the user\*(Aqs login shell\&. The default is to leave this field blank, which causes the system to select the default login shell specified by the
301 /etc/default/useradd, or an empty string by default\&.
304 \fB\-u\fR, \fB\-\-uid\fR\fIUID\fR
306 The numerical value of the user\*(Aqs ID\&. This value must be unique, unless the
308 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\&.
311 \fB\-U\fR, \fB\-\-user\-group\fR
313 Create a group with the same name as the user, and add the user to this group\&.
315 The default behavior (if the
319 options are not specified) is defined by the
320 \fBUSERGROUPS_ENAB\fR
325 \fB\-Z\fR, \fB\-\-selinux\-user\fR \fISEUSER\fR
327 The SELinux user for the user\*(Aqs login\&. The default is to leave this field blank, which causes the system to select the default SELinux user\&.
329 .SS "\(:Andrar standardv\(:arden"
331 When invoked with only the
335 will display the current default values\&. When invoked with
339 will update the default values for the specified options\&. Valid default\-changing options are:
341 \fB\-b\fR, \fB\-\-base\-dir\fR \fIBASE_DIR\fR
343 The path prefix for a new user\*(Aqs home directory\&. The user\*(Aqs name will be affixed to the end of
345 to form the new user\*(Aqs home directory name, if the
347 option is not used when creating a new account\&.
352 /etc/default/useradd\&.
355 \fB\-e\fR, \fB\-\-expiredate\fR\fIUTG\(oANGSDATUM\fR
357 Datumet n\(:ar anv\(:andarkontot blir inaktiverat\&.
362 /etc/default/useradd\&.
365 \fB\-f\fR, \fB\-\-inactive\fR\fIINAKTIV\fR
367 Antalet dagar efter att ett l\(:osenord har g\(oatt ut innan kontot kommer att inaktiveras\&.
372 /etc/default/useradd\&.
375 \fB\-g\fR, \fB\-\-gid\fR\fIGRUPP\fR
377 The group name or ID for a new user\*(Aqs initial group (when the
378 \fB\-N/\-\-no\-user\-group\fR
380 \fBUSERGROUPS_ENAB\fR
384 /etc/login\&.defs\&. The named group must exist, and a numerical group ID must have an existing entry\&.
389 /etc/default/useradd\&.
392 \fB\-s\fR, \fB\-\-shell\fR\fISKAL\fR
394 The name of a new user\*(Aqs login shell\&.
399 /etc/default/useradd\&.
403 The system administrator is responsible for placing the default user files in the
405 directory (or any other skeleton directory specified in
407 or on the command line)\&.
410 You may not add a user to a NIS or LDAP group\&. This must be performed on the corresponding server\&.
412 Similarly, if the username already exists in an external user database such as NIS or LDAP,
414 will deny the user account creation request\&.
416 Usernames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes\&. They can end with a dollar sign\&. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]?
418 Usernames may only be up to 32 characters long\&.
421 The following configuration variables in
423 change the behavior of this tool:
425 \fBCREATE_HOME\fR (boolean)
427 Indicate if a home directory should be created by default for new users\&.
429 This setting does not apply to system users, and can be overriden on the command line\&.
432 \fBGID_MAX\fR (number), \fBGID_MIN\fR (number)
434 Range of group IDs used for the creation of regular groups by
440 \fBMAIL_DIR\fR (string)
442 The mail spool directory\&. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted\&. If not specified, a compile\-time default is used\&.
445 \fBMAIL_FILE\fR (string)
447 Defines the location of the users mail spool files relatively to their home directory\&.
454 variables are used by
458 to create, move, or delete the user\*(Aqs mail spool\&.
461 \fBMAIL_CHECK_ENAB\fR
463 \fIyes\fR, they are also used to define the
465 environment variable\&.
467 \fBMAX_MEMBERS_PER_GROUP\fR (number)
469 Maximum members per group entry\&. When the maximum is reached, a new group entry (line) is started in
471 (with the same name, same password, and same GID)\&.
473 The default value is 0, meaning that there are no limits in the number of members in a group\&.
475 This feature (split group) permits to limit the length of lines in the group file\&. This is useful to make sure that lines for NIS groups are not larger than 1024 characters\&.
477 If you need to enforce such limit, you can use 25\&.
479 Note: split groups may not be supported by all tools (even in the Shadow toolsuite)\&. You should not use this variable unless you really need it\&.
482 \fBPASS_MAX_DAYS\fR (number)
484 The maximum number of days a password may be used\&. If the password is older than this, a password change will be forced\&. If not specified, \-1 will be assumed (which disables the restriction)\&.
487 \fBPASS_MIN_DAYS\fR (number)
489 The minimum number of days allowed between password changes\&. Any password changes attempted sooner than this will be rejected\&. If not specified, \-1 will be assumed (which disables the restriction)\&.
492 \fBPASS_WARN_AGE\fR (number)
494 The number of days warning given before a password expires\&. A zero means warning is given only upon the day of expiration, a negative value means no warning is given\&. If not specified, no warning will be provided\&.
497 \fBSYS_GID_MAX\fR (number), \fBSYS_GID_MIN\fR (number)
499 Range of group IDs used for the creation of system groups by
505 \fBSYS_UID_MAX\fR (number), \fBSYS_UID_MIN\fR (number)
507 Range of user IDs used for the creation of system users by
513 \fBUID_MAX\fR (number), \fBUID_MIN\fR (number)
515 Range of user IDs used for the creation of regular users by
523 The file mode creation mask is initialized to this value\&. If not specified, the mask will be initialized to 022\&.
529 use this mask to set the mode of the home directory they create
533 to define users\*(Aq initial umask\&. Note that this mask can be overriden by the user\*(Aqs GECOS line (if
535 is set) or by the specification of a limit with the
541 \fBUSERGROUPS_ENAB\fR (boolean)
543 Enable setting of the umask group bits to be the same as owner bits (examples: 022 \-> 002, 077 \-> 007) for non\-root users, if the uid is the same as gid, and username is the same as the primary group name\&.
548 will remove the user\*(Aqs group if it contains no more members, and
550 will create by default a group with the name of the user\&.
556 Anv\(:andarkontoinformation\&.
561 S\(:aker anv\(:andarkontoinformation\&.
566 Gruppkontoinformation\&.
571 S\(:aker gruppkontoinformation\&.
576 Standardv\(:arden f\(:or skapande av konto\&.
581 Katalog som inneh\(oaller standardfiler\&.
586 Shadow password suite configuration\&.
588 .SH "AVSLUTNINGSV\(:ARDEN"
592 avslutas med f\(:oljande v\(:arden:
601 kan inte uppdatera l\(:osenordsfilen
606 ogiltig kommandosyntax
611 ogiltigt argument till flagga
616 UID anv\(:ands redan (och inget
622 angiven grupp finns inte
627 anv\(:andarnamnet anv\(:ands redan
632 kan inte uppdatera gruppfilen
637 kan inte skapa hemkatalog
642 kan inte skapa postk\(:o