3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
6 .\" Manual: Команды управления системой
7 .\" Source: Команды управления системой
10 .TH "useradd" "8" "07/24/2009" "Команды управления системой" "Команды управления системой"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
16 .\" disable justification (adjust text to left margin only)
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
22 useradd \- регистрирует нового пользователя или изменяет информацию по умолчанию о новых пользователях
24 .HP \w'\fBuseradd\fR\ 'u
25 \fBuseradd\fR [\fIпараметры\fR] \fILOGIN\fR
26 .HP \w'\fBuseradd\fR\ 'u
28 .HP \w'\fBuseradd\fR\ 'u
29 \fBuseradd\fR \-D [\fIпараметры\fR]
32 When invoked without the
36 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
38 command will update system files and may also create the new user\'s home directory and copy initial files\&.
40 By default, a group will also be created for the new user (see
44 \fBUSERGROUPS_ENAB\fR)\&.
50 \fB\-b\fR, \fB\-\-base\-dir\fR\fIБАЗОВЫЙ_КАТАЛОГ\fR
52 The default base directory for the system if
57 is concatenated with the account name to define the home directory\&. If the
63 If this option is not specified,
65 will use the base directory specified by the
68 /etc/default/useradd, or
73 \fB\-c\fR, \fB\-\-comment\fR\fIКОММЕНТАРИЙ\fR
75 Любая текстовая строка\&. Обычно, здесь коротко описывается учётная запись, и в настоящее время используется как поле для имени и фамилии пользователя\&.
78 \fB\-d\fR, \fB\-\-home\fR\fIДОМАШНИЙ_КАТАЛОГ\fR
80 Для создаваемого пользователя будет использован каталог
82 в качестве начального каталога\&. По умолчанию, это значение получается объединением
85 \fIБАЗОВЫМ_КАТАЛОГОМ\fR
86 и используется как имя домашнего каталога\&. Каталог
88 необязательно должен существовать и не будет создан, если его нет\&.
91 \fB\-D\fR, \fB\-\-defaults\fR
93 See below, the subsection "Changing the default values"\&.
96 \fB\-e\fR, \fB\-\-expiredate\fR\fIДАТА_УСТАРЕВАНИЯ\fR
98 Дата, когда учётная запись пользователя будет заблокирована\&. Дата задаётся в формате
103 will use the default expiry date specified by the
106 /etc/default/useradd, or an empty string (no expiry) by default\&.
109 \fB\-f\fR, \fB\-\-inactive\fR\fIДНЕЙ\fR
111 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\&.
115 will use the default inactivity period specified by the
118 /etc/default/useradd, or \-1 by default\&.
121 \fB\-g\fR, \fB\-\-gid\fR\fIГРУППА\fR
123 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\&.
125 If not specified, the bahavior of
128 \fBUSERGROUPS_ENAB\fR
130 /etc/login\&.defs\&. If this variable is set to
133 \fB\-U/\-\-user\-group\fR
134 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
137 \fB\-N/\-\-no\-user\-group\fR
138 is specified on the command line), useradd will set the primary group of the new user to the value specified by the
141 /etc/default/useradd, or 100 by default\&.
144 \fB\-G\fR, \fB\-\-groups\fR\fIГРУППА1\fR[\fI,ГРУППА2,\&.\&.\&.\fR[\fI,ГРУППАN\fR]]]
146 Список дополнительных групп, в которых числится пользователь\&. Перечисление групп осуществляется через запятую, без промежуточных пробелов\&. На указанные группы действуют те же ограничения, что и для группы указанной в параметре
147 \fB\-g\fR\&. По умолчанию пользователь входит только в начальную группу\&.
150 \fB\-h\fR, \fB\-\-help\fR
152 Показать краткую справку и закончить работу\&.
155 \fB\-k\fR, \fB\-\-skel\fR \fISKEL_DIR\fR
157 The skeleton directory, which contains files and directories to be copied in the user\'s home directory, when the home directory is created by
160 This option is only valid if the
163 \fB\-\-create\-home\fR) option is specified\&.
165 If this option is not set, the skeleton directory is defined by the
173 \fB\-K\fR, \fB\-\-key\fR\fIКЛЮЧ\fR=\fIЗНАЧЕНИЕ\fR
177 defaults (\fBUID_MIN\fR,
184 \fB\-K \fR\fIPASS_MAX_DAYS\fR=\fI\-1\fR
185 can be used when creating system account to turn off password ageing, even though system account has no password at all\&. Multiple
187 options can be specified, e\&.g\&.:
189 \fIUID_MIN\fR=\fI100\fR
191 \fIUID_MAX\fR=\fI499\fR
193 Замечание: запись вида
194 \fB\-K \fR\fIUID_MIN\fR=\fI10\fR,\fIUID_MAX\fR=\fI499\fR
198 \fB\-l\fR, \fB\-\-no\-log\-init\fR
200 Do not add the user to the lastlog and faillog databases\&.
202 By default, the user\'s entries in the lastlog and faillog databases are resetted to avoid reusing the entry from a previously deleted user\&.
205 \fB\-m\fR, \fB\-\-create\-home\fR
207 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
209 option) will be copied to the home directory\&.
211 By default, no home directories are created\&.
216 Do no create the user\'s home directory, even if the system wide setting from
218 (\fBCREATE_HOME\fR) is set to
222 \fB\-N\fR, \fB\-\-no\-user\-group\fR
224 Do not create a group with the same name as the user, but add the user to the group specified by the
229 /etc/default/useradd\&.
231 The default behavior (if the
235 options are not specified) is defined by the
236 \fBUSERGROUPS_ENAB\fR
241 \fB\-o\fR, \fB\-\-non\-unique\fR
243 Позволяет создать учётную запись с уже имеющимся (не уникальным) UID\&.
245 This option is only valid in combination with the
250 \fB\-p\fR, \fB\-\-password\fR\fIПАРОЛЬ\fR
252 The encrypted password, as returned by
253 \fBcrypt\fR(3)\&. The default is to disable the password\&.
257 This option is not recommended because the password (or encrypted password) will be visible by users listing the processes\&.
259 You should make sure the password respects the system\'s password policy\&.
262 \fB\-r\fR, \fB\-\-system\fR
264 Create a system account\&.
266 System users will be created with no aging information in
267 /etc/shadow, and their numeric identifiers are choosen in the
268 \fBSYS_UID_MIN\fR\-\fBSYS_UID_MAX\fR
270 /etc/login\&.defs, instead of
271 \fBUID_MIN\fR\-\fBUID_MAX\fR
274 counterparts for the creation of groups)\&.
278 will not create a home directory for such an user, regardless of the default setting in
280 (\fBCREATE_HOME\fR)\&. You have to specify the
282 options if you want a home directory for a system account to be created\&.
285 \fB\-s\fR, \fB\-\-shell\fR\fIОБОЛОЧКА\fR
287 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 specified by the
290 /etc/default/useradd, or an empty string by default\&.
293 \fB\-u\fR, \fB\-\-uid\fR\fIUID\fR
295 Числовое значение идентификатора пользователя (ID)\&. Оно должно быть уникальным, если не используется параметр
296 \fB\-o\fR\&. Значение должно быть неотрицательным\&. По умолчанию используется наименьшее значение ID большее 999 и большее любого другого значения пользователя\&. Значения от 0 до 999 обычно зарезервированы для системных учётных записей\&.
299 \fB\-U\fR, \fB\-\-user\-group\fR
301 Create a group with the same name as the user, and add the user to this group\&.
303 The default behavior (if the
307 options are not specified) is defined by the
308 \fBUSERGROUPS_ENAB\fR
313 \fB\-Z\fR, \fB\-\-selinux\-user\fR \fISEUSER\fR
315 The SELinux user for the user\'s login\&. The default is to leave this field blank, which causes the system to select the default SELinux user\&.
317 .SS "Изменение значений по умолчанию"
319 When invoked with only the
323 will display the current default values\&. When invoked with
327 will update the default values for the specified options\&. Valid default\-changing options are:
329 \fB\-b\fR, \fB\-\-base\-dir\fR\fIБАЗОВЫЙ_КАТАЛОГ\fR
331 The path prefix for a new user\'s home directory\&. The user\'s name will be affixed to the end of
333 to form the new user\'s home directory name, if the
335 option is not used when creating a new account\&.
340 /etc/default/useradd\&.
343 \fB\-e\fR, \fB\-\-expiredate\fR\fIДАТА_УСТАРЕВАНИЯ\fR
345 Дата, когда учётная запись пользователя заблокирована\&.
350 /etc/default/useradd\&.
353 \fB\-f\fR, \fB\-\-inactive\fR\fIДНЕЙ\fR
355 Число дней, которые должны пройти после устаревания пароля, перед тем как учётная запись будет заблокирована\&.
360 /etc/default/useradd\&.
363 \fB\-g\fR, \fB\-\-gid\fR\fIГРУППА\fR
365 The group name or ID for a new user\'s initial group (when the
366 \fB\-N/\-\-no\-user\-group\fR
368 \fBUSERGROUPS_ENAB\fR
372 /etc/login\&.defs\&. The named group must exist, and a numerical group ID must have an existing entry\&.
377 /etc/default/useradd\&.
380 \fB\-s\fR, \fB\-\-shell\fR\fIОБОЛОЧКА\fR
382 The name of a new user\'s login shell\&.
387 /etc/default/useradd\&.
391 The system administrator is responsible for placing the default user files in the
393 directory (or any other skeleton directory specified in
395 or on the command line)\&.
396 .SH "ПРЕДОСТЕРЕЖЕНИЯ"
398 You may not add a user to a NIS or LDAP group\&. This must be performed on the corresponding server\&.
400 Similarly, if the username already exists in an external user database such as NIS or LDAP,
402 will deny the user account creation request\&.
404 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_\-]*[$]?
406 Usernames may only be up to 32 characters long\&.
409 The following configuration variables in
411 change the behavior of this tool:
413 \fBCREATE_HOME\fR (boolean)
415 Indicate if a home directory should be created by default for new users\&.
417 This setting does not apply to system users, and can be overriden on the command line\&.
420 \fBGID_MAX\fR (number), \fBGID_MIN\fR (number)
422 Range of group IDs used for the creation of regular groups by
428 \fBMAIL_DIR\fR (string)
430 Почтовый каталог\&. Данный параметр нужен для управления почтовым ящиком при изменении или удалении учётной записи пользователя\&. Если параметр не задан, то используется значение указанное при сборке\&.
433 \fBMAIL_FILE\fR (string)
435 Defines the location of the users mail spool files relatively to their home directory\&.
442 variables are used by
446 to create, move, or delete the user\'s mail spool\&.
449 \fBMAIL_CHECK_ENAB\fR
451 \fIyes\fR, they are also used to define the
453 environment variable\&.
455 \fBMAX_MEMBERS_PER_GROUP\fR (number)
457 Maximum members per group entry\&. When the maximum is reached, a new group entry (line) is started in
459 (with the same name, same password, and same GID)\&.
461 The default value is 0, meaning that there are no limits in the number of members in a group\&.
463 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\&.
465 If you need to enforce such limit, you can use 25\&.
467 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\&.
470 \fBPASS_MAX_DAYS\fR (number)
472 Максимальное число дней использования пароля\&. Если пароль старее этого числа, то будет запущена процедура смены пароля\&. Если значение не задано, то предполагается значение \-1 (то есть возможность ограничения не используется)\&.
475 \fBPASS_MIN_DAYS\fR (number)
477 Максимальное число дней между изменениями пароля\&. Любая смена пароля ранее заданного срока выполнена не будет\&. Если значение не задано, то предполагается значение \-1 (то есть возможность ограничения не используется)\&.
480 \fBPASS_WARN_AGE\fR (number)
482 Число дней за которое начнёт выдаваться предупреждение об устаревании пароля\&. Нулевое значение означает, что предупреждение выдаётся в день устаревания, при отрицательном значении предупреждение выдаваться не будет\&. Если значение не задано, выдача предупреждения отключается\&.
485 \fBSYS_GID_MAX\fR (number), \fBSYS_GID_MIN\fR (number)
487 Range of group IDs used for the creation of system groups by
493 \fBSYS_UID_MAX\fR (number), \fBSYS_UID_MIN\fR (number)
495 Range of user IDs used for the creation of system users by
501 \fBUID_MAX\fR (number), \fBUID_MIN\fR (number)
503 Range of user IDs used for the creation of regular users by
511 The file mode creation mask is initialized to this value\&. If not specified, the mask will be initialized to 022\&.
517 use this mask to set the mode of the home directory they create
521 to define users\' initial umask\&. Note that this mask can be overriden by the user\'s GECOS line (if
523 is set) or by the specification of a limit with the
529 \fBUSERGROUPS_ENAB\fR (boolean)
531 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\&.
536 will remove the user\'s group if it contains no more members, and
538 will create by default a group with the name of the user\&.
544 содержит информацию о пользователях
549 содержит защищаемую информацию о пользователях
554 содержит информацию о группах
559 содержит защищаемую информацию о группах
564 содержит защищаемую информацию о пользователях
569 каталог, содержащий пользовательские файлы по умолчанию
574 содержит конфигурацию подсистемы теневых паролей
576 .SH "ВОЗВРАЩАЕМЫЕ ЗНАЧЕНИЯ"
580 завершая работу, возвращает следующие значения:
589 не удалось изменить файл паролей
594 ошибка в параметрах команды
599 недопустимое значение параметра
604 такой UID уже существует (и не задан параметр
610 указанная группа не существует
615 имя пользователя уже существует
620 не удалось изменить файл групп
625 не удалось создать домашний каталог
630 не удалось создать почтовый ящик