Initialize Tizen 2.3
[external/shadow-utils.git] / man / ru / useradd.8
1 '\" t
2 .\"     Title: useradd
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
5 .\"      Date: 07/24/2009
6 .\"    Manual: Команды управления системой
7 .\"    Source: Команды управления системой
8 .\"  Language: Russian
9 .\"
10 .TH "useradd" "8" "07/24/2009" "Команды управления системой" "Команды управления системой"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
15 .nh
16 .\" disable justification (adjust text to left margin only)
17 .ad l
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
21 .SH "НАЗВАНИЕ"
22 useradd \- регистрирует нового пользователя или изменяет информацию по умолчанию о новых пользователях
23 .SH "СИНТАКСИС"
24 .HP \w'\fBuseradd\fR\ 'u
25 \fBuseradd\fR [\fIпараметры\fR] \fILOGIN\fR
26 .HP \w'\fBuseradd\fR\ 'u
27 \fBuseradd\fR \-D
28 .HP \w'\fBuseradd\fR\ 'u
29 \fBuseradd\fR \-D [\fIпараметры\fR]
30 .SH "ОПИСАНИЕ"
31 .PP
32 When invoked without the
33 \fB\-D\fR
34 option, the
35 \fBuseradd\fR
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
37 \fBuseradd\fR
38 command will update system files and may also create the new user\'s home directory and copy initial files\&.
39 .PP
40 By default, a group will also be created for the new user (see
41 \fB\-g\fR,
42 \fB\-N\fR,
43 \fB\-U\fR, and
44 \fBUSERGROUPS_ENAB\fR)\&.
45 .SH "ПАРАМЕТРЫ"
46 .PP
47 Параметры команды
48 \fBuseradd\fR:
49 .PP
50 \fB\-b\fR, \fB\-\-base\-dir\fR\fIБАЗОВЫЙ_КАТАЛОГ\fR
51 .RS 4
52 The default base directory for the system if
53 \fB\-d\fR
54 \fIHOME_DIR\fR
55 is not specified\&.
56 \fIBASE_DIR\fR
57 is concatenated with the account name to define the home directory\&. If the
58 \fB\-m\fR
59 option is not used,
60 \fIBASE_DIR\fR
61 must exist\&.
62 .sp
63 If this option is not specified,
64 \fBuseradd\fR
65 will use the base directory specified by the
66 \fBHOME\fR
67 variable in
68 /etc/default/useradd, or
69 /home
70 by default\&.
71 .RE
72 .PP
73 \fB\-c\fR, \fB\-\-comment\fR\fIКОММЕНТАРИЙ\fR
74 .RS 4
75 Любая текстовая строка\&. Обычно, здесь коротко описывается учётная запись, и в настоящее время используется как поле для имени и фамилии пользователя\&.
76 .RE
77 .PP
78 \fB\-d\fR, \fB\-\-home\fR\fIДОМАШНИЙ_КАТАЛОГ\fR
79 .RS 4
80 Для создаваемого пользователя будет использован каталог
81 \fIБАЗОВЫЙ_КАТАЛОГ\fR
82 в качестве начального каталога\&. По умолчанию, это значение получается объединением
83 \fIИМЕНИ\fR
84 пользователя с
85 \fIБАЗОВЫМ_КАТАЛОГОМ\fR
86 и используется как имя домашнего каталога\&. Каталог
87 \fIБАЗОВЫЙ_КАТАЛОГ\fR
88 необязательно должен существовать и не будет создан, если его нет\&.
89 .RE
90 .PP
91 \fB\-D\fR, \fB\-\-defaults\fR
92 .RS 4
93 See below, the subsection "Changing the default values"\&.
94 .RE
95 .PP
96 \fB\-e\fR, \fB\-\-expiredate\fR\fIДАТА_УСТАРЕВАНИЯ\fR
97 .RS 4
98 Дата, когда учётная запись пользователя будет заблокирована\&. Дата задаётся в формате
99 \fIГГГГ\-ММ\-ДД\fR\&.
100 .sp
101 If not specified,
102 \fBuseradd\fR
103 will use the default expiry date specified by the
104 \fBEXPIRE\fR
105 variable in
106 /etc/default/useradd, or an empty string (no expiry) by default\&.
107 .RE
108 .PP
109 \fB\-f\fR, \fB\-\-inactive\fR\fIДНЕЙ\fR
110 .RS 4
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\&.
112 .sp
113 If not specified,
114 \fBuseradd\fR
115 will use the default inactivity period specified by the
116 \fBINACTIVE\fR
117 variable in
118 /etc/default/useradd, or \-1 by default\&.
119 .RE
120 .PP
121 \fB\-g\fR, \fB\-\-gid\fR\fIГРУППА\fR
122 .RS 4
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\&.
124 .sp
125 If not specified, the bahavior of
126 \fBuseradd\fR
127 will depend on the
128 \fBUSERGROUPS_ENAB\fR
129 variable in
130 /etc/login\&.defs\&. If this variable is set to
131 \fIyes\fR
132 (or
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
135 \fIno\fR
136 (or
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
139 \fBGROUP\fR
140 variable in
141 /etc/default/useradd, or 100 by default\&.
142 .RE
143 .PP
144 \fB\-G\fR, \fB\-\-groups\fR\fIГРУППА1\fR[\fI,ГРУППА2,\&.\&.\&.\fR[\fI,ГРУППАN\fR]]]
145 .RS 4
146 Список дополнительных групп, в которых числится пользователь\&. Перечисление групп осуществляется через запятую, без промежуточных пробелов\&. На указанные группы действуют те же ограничения, что и для группы указанной в параметре
147 \fB\-g\fR\&. По умолчанию пользователь входит только в начальную группу\&.
148 .RE
149 .PP
150 \fB\-h\fR, \fB\-\-help\fR
151 .RS 4
152 Показать краткую справку и закончить работу\&.
153 .RE
154 .PP
155 \fB\-k\fR, \fB\-\-skel\fR \fISKEL_DIR\fR
156 .RS 4
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
158 \fBuseradd\fR\&.
159 .sp
160 This option is only valid if the
161 \fB\-m\fR
162 (or
163 \fB\-\-create\-home\fR) option is specified\&.
164 .sp
165 If this option is not set, the skeleton directory is defined by the
166 \fBSKEL\fR
167 variable in
168 /etc/default/useradd
169 or, by default,
170 /etc/skel\&.
171 .RE
172 .PP
173 \fB\-K\fR, \fB\-\-key\fR\fIКЛЮЧ\fR=\fIЗНАЧЕНИЕ\fR
174 .RS 4
175 Overrides
176 /etc/login\&.defs
177 defaults (\fBUID_MIN\fR,
178 \fBUID_MAX\fR,
179 \fBUMASK\fR,
180 \fBPASS_MAX_DAYS\fR
181 and others)\&.
182
183 Example:
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
186 \fB\-K\fR
187 options can be specified, e\&.g\&.:
188 \fB\-K \fR
189 \fIUID_MIN\fR=\fI100\fR
190 \fB\-K \fR
191 \fIUID_MAX\fR=\fI499\fR
192 .sp
193 Замечание: запись вида
194 \fB\-K \fR\fIUID_MIN\fR=\fI10\fR,\fIUID_MAX\fR=\fI499\fR
195 пока не работает\&.
196 .RE
197 .PP
198 \fB\-l\fR, \fB\-\-no\-log\-init\fR
199 .RS 4
200 Do not add the user to the lastlog and faillog databases\&.
201 .sp
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\&.
203 .RE
204 .PP
205 \fB\-m\fR, \fB\-\-create\-home\fR
206 .RS 4
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
208 \fB\-k\fR
209 option) will be copied to the home directory\&.
210 .sp
211 By default, no home directories are created\&.
212 .RE
213 .PP
214 \fB\-M\fR
215 .RS 4
216 Do no create the user\'s home directory, even if the system wide setting from
217 /etc/login\&.defs
218 (\fBCREATE_HOME\fR) is set to
219 \fIyes\fR\&.
220 .RE
221 .PP
222 \fB\-N\fR, \fB\-\-no\-user\-group\fR
223 .RS 4
224 Do not create a group with the same name as the user, but add the user to the group specified by the
225 \fB\-g\fR
226 option or by the
227 \fBGROUP\fR
228 variable in
229 /etc/default/useradd\&.
230 .sp
231 The default behavior (if the
232 \fB\-g\fR,
233 \fB\-N\fR, and
234 \fB\-U\fR
235 options are not specified) is defined by the
236 \fBUSERGROUPS_ENAB\fR
237 variable in
238 /etc/login\&.defs\&.
239 .RE
240 .PP
241 \fB\-o\fR, \fB\-\-non\-unique\fR
242 .RS 4
243 Позволяет создать учётную запись с уже имеющимся (не уникальным) UID\&.
244 .sp
245 This option is only valid in combination with the
246 \fB\-o\fR
247 option\&.
248 .RE
249 .PP
250 \fB\-p\fR, \fB\-\-password\fR\fIПАРОЛЬ\fR
251 .RS 4
252 The encrypted password, as returned by
253 \fBcrypt\fR(3)\&. The default is to disable the password\&.
254 .sp
255
256 \fBNote:\fR
257 This option is not recommended because the password (or encrypted password) will be visible by users listing the processes\&.
258 .sp
259 You should make sure the password respects the system\'s password policy\&.
260 .RE
261 .PP
262 \fB\-r\fR, \fB\-\-system\fR
263 .RS 4
264 Create a system account\&.
265 .sp
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
269 range, defined in
270 /etc/login\&.defs, instead of
271 \fBUID_MIN\fR\-\fBUID_MAX\fR
272 (and their
273 \fBGID\fR
274 counterparts for the creation of groups)\&.
275 .sp
276 Note that
277 \fBuseradd\fR
278 will not create a home directory for such an user, regardless of the default setting in
279 /etc/login\&.defs
280 (\fBCREATE_HOME\fR)\&. You have to specify the
281 \fB\-m\fR
282 options if you want a home directory for a system account to be created\&.
283 .RE
284 .PP
285 \fB\-s\fR, \fB\-\-shell\fR\fIОБОЛОЧКА\fR
286 .RS 4
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
288 \fBSHELL\fR
289 variable in
290 /etc/default/useradd, or an empty string by default\&.
291 .RE
292 .PP
293 \fB\-u\fR, \fB\-\-uid\fR\fIUID\fR
294 .RS 4
295 Числовое значение идентификатора пользователя (ID)\&. Оно должно быть уникальным, если не используется параметр
296 \fB\-o\fR\&. Значение должно быть неотрицательным\&. По умолчанию используется наименьшее значение ID большее 999 и большее любого другого значения пользователя\&. Значения от 0 до 999 обычно зарезервированы для системных учётных записей\&.
297 .RE
298 .PP
299 \fB\-U\fR, \fB\-\-user\-group\fR
300 .RS 4
301 Create a group with the same name as the user, and add the user to this group\&.
302 .sp
303 The default behavior (if the
304 \fB\-g\fR,
305 \fB\-N\fR, and
306 \fB\-U\fR
307 options are not specified) is defined by the
308 \fBUSERGROUPS_ENAB\fR
309 variable in
310 /etc/login\&.defs\&.
311 .RE
312 .PP
313 \fB\-Z\fR, \fB\-\-selinux\-user\fR \fISEUSER\fR
314 .RS 4
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\&.
316 .RE
317 .SS "Изменение значений по умолчанию"
318 .PP
319 When invoked with only the
320 \fB\-D\fR
321 option,
322 \fBuseradd\fR
323 will display the current default values\&. When invoked with
324 \fB\-D\fR
325 plus other options,
326 \fBuseradd\fR
327 will update the default values for the specified options\&. Valid default\-changing options are:
328 .PP
329 \fB\-b\fR, \fB\-\-base\-dir\fR\fIБАЗОВЫЙ_КАТАЛОГ\fR
330 .RS 4
331 The path prefix for a new user\'s home directory\&. The user\'s name will be affixed to the end of
332 \fIBASE_DIR\fR
333 to form the new user\'s home directory name, if the
334 \fB\-d\fR
335 option is not used when creating a new account\&.
336 .sp
337 This option sets the
338 \fBHOME\fR
339 variable in
340 /etc/default/useradd\&.
341 .RE
342 .PP
343 \fB\-e\fR, \fB\-\-expiredate\fR\fIДАТА_УСТАРЕВАНИЯ\fR
344 .RS 4
345 Дата, когда учётная запись пользователя заблокирована\&.
346 .sp
347 This option sets the
348 \fBEXPIRE\fR
349 variable in
350 /etc/default/useradd\&.
351 .RE
352 .PP
353 \fB\-f\fR, \fB\-\-inactive\fR\fIДНЕЙ\fR
354 .RS 4
355 Число дней, которые должны пройти после устаревания пароля, перед тем как учётная запись будет заблокирована\&.
356 .sp
357 This option sets the
358 \fBINACTIVE\fR
359 variable in
360 /etc/default/useradd\&.
361 .RE
362 .PP
363 \fB\-g\fR, \fB\-\-gid\fR\fIГРУППА\fR
364 .RS 4
365 The group name or ID for a new user\'s initial group (when the
366 \fB\-N/\-\-no\-user\-group\fR
367 is used or when the
368 \fBUSERGROUPS_ENAB\fR
369 variable is set to
370 \fIno\fR
371 in
372 /etc/login\&.defs\&. The named group must exist, and a numerical group ID must have an existing entry\&.
373 .sp
374 This option sets the
375 \fBGROUP\fR
376 variable in
377 /etc/default/useradd\&.
378 .RE
379 .PP
380 \fB\-s\fR, \fB\-\-shell\fR\fIОБОЛОЧКА\fR
381 .RS 4
382 The name of a new user\'s login shell\&.
383 .sp
384 This option sets the
385 \fBSHELL\fR
386 variable in
387 /etc/default/useradd\&.
388 .RE
389 .SH "ЗАМЕЧАНИЯ"
390 .PP
391 The system administrator is responsible for placing the default user files in the
392 /etc/skel/
393 directory (or any other skeleton directory specified in
394 /etc/default/useradd
395 or on the command line)\&.
396 .SH "ПРЕДОСТЕРЕЖЕНИЯ"
397 .PP
398 You may not add a user to a NIS or LDAP group\&. This must be performed on the corresponding server\&.
399 .PP
400 Similarly, if the username already exists in an external user database such as NIS or LDAP,
401 \fBuseradd\fR
402 will deny the user account creation request\&.
403 .PP
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_\-]*[$]?
405 .PP
406 Usernames may only be up to 32 characters long\&.
407 .SH "CONFIGURATION"
408 .PP
409 The following configuration variables in
410 /etc/login\&.defs
411 change the behavior of this tool:
412 .PP
413 \fBCREATE_HOME\fR (boolean)
414 .RS 4
415 Indicate if a home directory should be created by default for new users\&.
416 .sp
417 This setting does not apply to system users, and can be overriden on the command line\&.
418 .RE
419 .PP
420 \fBGID_MAX\fR (number), \fBGID_MIN\fR (number)
421 .RS 4
422 Range of group IDs used for the creation of regular groups by
423 \fBuseradd\fR,
424 \fBgroupadd\fR, or
425 \fBnewusers\fR\&.
426 .RE
427 .PP
428 \fBMAIL_DIR\fR (string)
429 .RS 4
430 Почтовый каталог\&. Данный параметр нужен для управления почтовым ящиком при изменении или удалении учётной записи пользователя\&. Если параметр не задан, то используется значение указанное при сборке\&.
431 .RE
432 .PP
433 \fBMAIL_FILE\fR (string)
434 .RS 4
435 Defines the location of the users mail spool files relatively to their home directory\&.
436 .RE
437 .PP
438 The
439 \fBMAIL_DIR\fR
440 and
441 \fBMAIL_FILE\fR
442 variables are used by
443 \fBuseradd\fR,
444 \fBusermod\fR, and
445 \fBuserdel\fR
446 to create, move, or delete the user\'s mail spool\&.
447 .PP
448 If
449 \fBMAIL_CHECK_ENAB\fR
450 is set to
451 \fIyes\fR, they are also used to define the
452 \fBMAIL\fR
453 environment variable\&.
454 .PP
455 \fBMAX_MEMBERS_PER_GROUP\fR (number)
456 .RS 4
457 Maximum members per group entry\&. When the maximum is reached, a new group entry (line) is started in
458 /etc/group
459 (with the same name, same password, and same GID)\&.
460 .sp
461 The default value is 0, meaning that there are no limits in the number of members in a group\&.
462 .sp
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\&.
464 .sp
465 If you need to enforce such limit, you can use 25\&.
466 .sp
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\&.
468 .RE
469 .PP
470 \fBPASS_MAX_DAYS\fR (number)
471 .RS 4
472 Максимальное число дней использования пароля\&. Если пароль старее этого числа, то будет запущена процедура смены пароля\&. Если значение не задано, то предполагается значение \-1 (то есть возможность ограничения не используется)\&.
473 .RE
474 .PP
475 \fBPASS_MIN_DAYS\fR (number)
476 .RS 4
477 Максимальное число дней между изменениями пароля\&. Любая смена пароля ранее заданного срока выполнена не будет\&. Если значение не задано, то предполагается значение \-1 (то есть возможность ограничения не используется)\&.
478 .RE
479 .PP
480 \fBPASS_WARN_AGE\fR (number)
481 .RS 4
482 Число дней за которое начнёт выдаваться предупреждение об устаревании пароля\&. Нулевое значение означает, что предупреждение выдаётся в день устаревания, при отрицательном значении предупреждение выдаваться не будет\&. Если значение не задано, выдача предупреждения отключается\&.
483 .RE
484 .PP
485 \fBSYS_GID_MAX\fR (number), \fBSYS_GID_MIN\fR (number)
486 .RS 4
487 Range of group IDs used for the creation of system groups by
488 \fBuseradd\fR,
489 \fBgroupadd\fR, or
490 \fBnewusers\fR\&.
491 .RE
492 .PP
493 \fBSYS_UID_MAX\fR (number), \fBSYS_UID_MIN\fR (number)
494 .RS 4
495 Range of user IDs used for the creation of system users by
496 \fBuseradd\fR
497 or
498 \fBnewusers\fR\&.
499 .RE
500 .PP
501 \fBUID_MAX\fR (number), \fBUID_MIN\fR (number)
502 .RS 4
503 Range of user IDs used for the creation of regular users by
504 \fBuseradd\fR
505 or
506 \fBnewusers\fR\&.
507 .RE
508 .PP
509 \fBUMASK\fR (number)
510 .RS 4
511 The file mode creation mask is initialized to this value\&. If not specified, the mask will be initialized to 022\&.
512 .sp
513
514 \fBuseradd\fR
515 and
516 \fBnewusers\fR
517 use this mask to set the mode of the home directory they create
518 .sp
519 It is also used by
520 \fBlogin\fR
521 to define users\' initial umask\&. Note that this mask can be overriden by the user\'s GECOS line (if
522 \fBQUOTAS_ENAB\fR
523 is set) or by the specification of a limit with the
524 \fIK\fR
525 identifier in
526 \fBlimits\fR(5)\&.
527 .RE
528 .PP
529 \fBUSERGROUPS_ENAB\fR (boolean)
530 .RS 4
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\&.
532 .sp
533 If set to
534 \fIyes\fR,
535 \fBuserdel\fR
536 will remove the user\'s group if it contains no more members, and
537 \fBuseradd\fR
538 will create by default a group with the name of the user\&.
539 .RE
540 .SH "ФАЙЛЫ"
541 .PP
542 /etc/passwd
543 .RS 4
544 содержит информацию о пользователях
545 .RE
546 .PP
547 /etc/shadow
548 .RS 4
549 содержит защищаемую информацию о пользователях
550 .RE
551 .PP
552 /etc/group
553 .RS 4
554 содержит информацию о группах
555 .RE
556 .PP
557 /etc/gshadow
558 .RS 4
559 содержит защищаемую информацию о группах
560 .RE
561 .PP
562 /etc/default/useradd
563 .RS 4
564 содержит защищаемую информацию о пользователях
565 .RE
566 .PP
567 /etc/skel/
568 .RS 4
569 каталог, содержащий пользовательские файлы по умолчанию
570 .RE
571 .PP
572 /etc/login\&.defs
573 .RS 4
574 содержит конфигурацию подсистемы теневых паролей
575 .RE
576 .SH "ВОЗВРАЩАЕМЫЕ ЗНАЧЕНИЯ"
577 .PP
578 Команда
579 \fBuseradd\fR
580 завершая работу, возвращает следующие значения:
581 .PP
582 \fI0\fR
583 .RS 4
584 успешное выполнение
585 .RE
586 .PP
587 \fI1\fR
588 .RS 4
589 не удалось изменить файл паролей
590 .RE
591 .PP
592 \fI2\fR
593 .RS 4
594 ошибка в параметрах команды
595 .RE
596 .PP
597 \fI3\fR
598 .RS 4
599 недопустимое значение параметра
600 .RE
601 .PP
602 \fI4\fR
603 .RS 4
604 такой UID уже существует (и не задан параметр
605 \fB\-o\fR)
606 .RE
607 .PP
608 \fI6\fR
609 .RS 4
610 указанная группа не существует
611 .RE
612 .PP
613 \fI9\fR
614 .RS 4
615 имя пользователя уже существует
616 .RE
617 .PP
618 \fI10\fR
619 .RS 4
620 не удалось изменить файл групп
621 .RE
622 .PP
623 \fI12\fR
624 .RS 4
625 не удалось создать домашний каталог
626 .RE
627 .PP
628 \fI13\fR
629 .RS 4
630 не удалось создать почтовый ящик
631 .RE
632 .SH "СМОТРИТЕ ТАКЖЕ"
633 .PP
634 \fBchfn\fR(1),
635 \fBchsh\fR(1),
636 \fBpasswd\fR(1),
637 \fBcrypt\fR(3),
638 \fBgroupadd\fR(8),
639 \fBgroupdel\fR(8),
640 \fBgroupmod\fR(8),
641 \fBlogin.defs\fR(5),
642 \fBnewusers\fR(8),
643 \fBuserdel\fR(8),
644 \fBusermod\fR(8)\&.