436 lines
16 KiB
Plaintext
436 lines
16 KiB
Plaintext
'\" t
|
|
.\" Title: newusers
|
|
.\" Author: Julianne Frances Haugh
|
|
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
|
.\" Date: 12/01/2019
|
|
.\" Manual: Команды управления системой
|
|
.\" Source: shadow-utils 4.8
|
|
.\" Language: Russian
|
|
.\"
|
|
.TH "newusers" "8" "12/01/2019" "shadow\-utils 4\&.8" "Команды управления системой"
|
|
.\" -----------------------------------------------------------------
|
|
.\" * Define some portability stuff
|
|
.\" -----------------------------------------------------------------
|
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
.\" http://bugs.debian.org/507673
|
|
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
.ie \n(.g .ds Aq \(aq
|
|
.el .ds Aq '
|
|
.\" -----------------------------------------------------------------
|
|
.\" * set default formatting
|
|
.\" -----------------------------------------------------------------
|
|
.\" disable hyphenation
|
|
.nh
|
|
.\" disable justification (adjust text to left margin only)
|
|
.ad l
|
|
.\" -----------------------------------------------------------------
|
|
.\" * MAIN CONTENT STARTS HERE *
|
|
.\" -----------------------------------------------------------------
|
|
.SH "НАЗВАНИЕ"
|
|
newusers \- обновляет и создаёт новые учётные записи пользователей в пакетном режиме
|
|
.SH "СИНТАКСИС"
|
|
.HP \w'\fBnewusers\fR\ 'u
|
|
\fBnewusers\fR [\fIпараметры\fR] [\fIфайл\fR]
|
|
.SH "ОПИСАНИЕ"
|
|
.PP
|
|
The
|
|
\fBnewusers\fR
|
|
command reads a
|
|
\fIfile\fR
|
|
(or the standard input by default) and uses this information to update a set of existing users or to create new users\&. Each line is in the same format as the standard password file (see
|
|
\fBpasswd\fR(5)) with the exceptions explained below:
|
|
.PP
|
|
pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell
|
|
.PP
|
|
\fIpw_name\fR
|
|
.RS 4
|
|
Имя пользователя\&.
|
|
.sp
|
|
It can be the name of a new user or the name of an existing user (or a user created before by
|
|
\fBnewusers\fR)\&. In case of an existing user, the user\*(Aqs information will be changed, otherwise a new user will be created\&.
|
|
.RE
|
|
.PP
|
|
\fIpw_passwd\fR
|
|
.RS 4
|
|
Это поле будет зашифровано и использовано как новое значение шифрованного пароля\&.
|
|
.RE
|
|
.PP
|
|
\fI pw_gid\fR
|
|
.RS 4
|
|
Это поле используется для определения UID пользователя\&.
|
|
.sp
|
|
If the field is empty, a new (unused) UID will be defined automatically by
|
|
\fBnewusers\fR\&.
|
|
.sp
|
|
Если в этом поле указано число, то оно будет использовано в качестве UID\&.
|
|
.sp
|
|
If this field contains the name of an existing user (or the name of a user created before by
|
|
\fBnewusers\fR), the UID of the specified user will be used\&.
|
|
.sp
|
|
Если изменяется UID существующего пользователя, то у файлов, которыми владел этот пользователь, нужно вручную переопределить владельца\&.
|
|
.RE
|
|
.PP
|
|
\fIpw_gid\fR
|
|
.RS 4
|
|
Это поле используется для определения ID первичной группы пользователя\&.
|
|
.sp
|
|
If this field contains the name of an existing group (or a group created before by
|
|
\fBnewusers\fR), the GID of this group will be used as the primary group ID for the user\&.
|
|
.sp
|
|
Если в этом поле содержится число, то это число будет использовано как ID первичной группы пользователя\&. Если с таким GID не существует, то будет создана новая группа с этим GID и именем пользователя\&.
|
|
.sp
|
|
If this field is empty, a new group will be created with the name of the user and a GID will be automatically defined by
|
|
\fBnewusers\fR
|
|
to be used as the primary group ID for the user and as the GID for the new group\&.
|
|
.sp
|
|
If this field contains the name of a group which does not exist (and was not created before by
|
|
\fBnewusers\fR), a new group will be created with the specified name and a GID will be automatically defined by
|
|
\fBnewusers\fR
|
|
to be used as the primary group ID for the user and GID for the new group\&.
|
|
.RE
|
|
.PP
|
|
\fIpw_gecos\fR
|
|
.RS 4
|
|
Это поле копируется в поле GECOS записи пользователя\&.
|
|
.RE
|
|
.PP
|
|
\fIpw_dir\fR
|
|
.RS 4
|
|
Это поле используется для определения домашнего каталога пользователя\&.
|
|
.sp
|
|
Если это поле указывает на несуществующий каталог, то указанный каталог создаётся, его владельцем назначается создаваемый или обновляемый пользователь и его первичная группа\&.
|
|
.sp
|
|
If the home directory of an existing user is changed,
|
|
\fBnewusers\fR
|
|
does not move or copy the content of the old directory to the new location\&. This should be done manually\&.
|
|
.RE
|
|
.PP
|
|
\fIpw_shell\fR
|
|
.RS 4
|
|
В этом поле задаётся пользовательская оболочка\&. Никаких проверок поля не делается\&.
|
|
.RE
|
|
.PP
|
|
\fBnewusers\fR
|
|
first tries to create or change all the specified users, and then write these changes to the user or group databases\&. If an error occurs (except in the final writes to the databases), no changes are committed to the databases\&.
|
|
.PP
|
|
Данная команда предназначена для работы в крупных системных средах, где за один раз обновляется несколько учётных записей\&.
|
|
.SH "ПАРАМЕТРЫ"
|
|
.PP
|
|
The options which apply to the
|
|
\fBnewusers\fR
|
|
command are:
|
|
.PP
|
|
\fB\-\-badname\fR\ \&
|
|
.RS 4
|
|
Allow names that do not conform to standards\&.
|
|
.RE
|
|
.PP
|
|
\fB\-c\fR, \fB\-\-crypt\-method\fR
|
|
.RS 4
|
|
Использовать указанный метод для шифрования паролей\&.
|
|
.sp
|
|
Возможные методы: DES, MD5, NONE и SHA256 или SHA512, если эти методы поддерживается libc\&.
|
|
.RE
|
|
.PP
|
|
\fB\-h\fR, \fB\-\-help\fR
|
|
.RS 4
|
|
Показать краткую справку и закончить работу\&.
|
|
.RE
|
|
.PP
|
|
\fB\-r\fR, \fB\-\-system\fR
|
|
.RS 4
|
|
Создать системную учётную запись\&.
|
|
.sp
|
|
System users will be created with no aging information in
|
|
/etc/shadow, and their numeric identifiers are chosen in the
|
|
\fBSYS_UID_MIN\fR\-\fBSYS_UID_MAX\fR
|
|
range, defined in
|
|
login\&.defs, instead of
|
|
\fBUID_MIN\fR\-\fBUID_MAX\fR
|
|
(and their
|
|
\fBGID\fR
|
|
counterparts for the creation of groups)\&.
|
|
.RE
|
|
.PP
|
|
\fB\-R\fR, \fB\-\-root\fR\ \&\fICHROOT_DIR\fR
|
|
.RS 4
|
|
Apply changes in the
|
|
\fICHROOT_DIR\fR
|
|
directory and use the configuration files from the
|
|
\fICHROOT_DIR\fR
|
|
directory\&.
|
|
.RE
|
|
.PP
|
|
\fB\-s\fR, \fB\-\-sha\-rounds\fR
|
|
.RS 4
|
|
Использовать указанное количество раундов шифрования паролей\&.
|
|
.sp
|
|
Значение 0 означает, что система выберет количество раундов по умолчанию для выбранного метода шифрования (5000)\&.
|
|
.sp
|
|
Минимальное значение равно 1000, а максимальное значение равно 999,999,999\&.
|
|
.sp
|
|
Вы можете использовать этот параметр только при методе шифрования SHA256 или SHA512\&.
|
|
.sp
|
|
By default, the number of rounds is defined by the SHA_CRYPT_MIN_ROUNDS and SHA_CRYPT_MAX_ROUNDS variables in
|
|
/etc/login\&.defs\&.
|
|
.RE
|
|
.SH "ПРЕДОСТЕРЕЖЕНИЯ"
|
|
.PP
|
|
Файл с входными данными должен быть защищён, так как в нём содержатся не шифрованные пароли\&.
|
|
.PP
|
|
Вы должны проверить, что пароль и метод шифрования соответствует политике системных паролей\&.
|
|
.SH "НАСТРОЙКА"
|
|
.PP
|
|
The following configuration variables in
|
|
/etc/login\&.defs
|
|
change the behavior of this tool:
|
|
.PP
|
|
\fBENCRYPT_METHOD\fR (string)
|
|
.RS 4
|
|
Задаёт системный алгоритм шифрования по умолчанию для шифрования паролей (используется, если алгоритм не указан в командной строке)\&.
|
|
.sp
|
|
It can take one of these values:
|
|
\fIDES\fR
|
|
(default),
|
|
\fIMD5\fR, \fISHA256\fR, \fISHA512\fR\&.
|
|
.sp
|
|
Note: this parameter overrides the
|
|
\fBMD5_CRYPT_ENAB\fR
|
|
variable\&.
|
|
.RE
|
|
.PP
|
|
\fBGID_MAX\fR (number), \fBGID_MIN\fR (number)
|
|
.RS 4
|
|
Range of group IDs used for the creation of regular groups by
|
|
\fBuseradd\fR,
|
|
\fBgroupadd\fR, or
|
|
\fBnewusers\fR\&.
|
|
.sp
|
|
The default value for
|
|
\fBGID_MIN\fR
|
|
(resp\&.
|
|
\fBGID_MAX\fR) is 1000 (resp\&. 60000)\&.
|
|
.RE
|
|
.PP
|
|
\fBMAX_MEMBERS_PER_GROUP\fR (number)
|
|
.RS 4
|
|
Maximum members per group entry\&. When the maximum is reached, a new group entry (line) is started in
|
|
/etc/group
|
|
(with the same name, same password, and same GID)\&.
|
|
.sp
|
|
Значение по умолчанию равно 0, означающее, что ограничения на количество членов в группе нет\&.
|
|
.sp
|
|
Данная возможность (разделение группы) позволяет ограничить длину строк в файле групп\&. Это полезно для ограничения длины строк групп NIS в 1024 символа\&.
|
|
.sp
|
|
Если вам нужно такое ограничение, укажите значение 25\&.
|
|
.sp
|
|
Замечание: разделение групп поддерживается не всеми инструментами (даже в наборе инструментов Shadow)\&. Вы не должны использовать эту переменную, если вам действительно это ненужно\&.
|
|
.RE
|
|
.PP
|
|
\fBMD5_CRYPT_ENAB\fR (boolean)
|
|
.RS 4
|
|
Indicate if passwords must be encrypted using the MD5\-based algorithm\&. If set to
|
|
\fIyes\fR, new passwords will be encrypted using the MD5\-based algorithm compatible with the one used by recent releases of FreeBSD\&. It supports passwords of unlimited length and longer salt strings\&. Set to
|
|
\fIno\fR
|
|
if you need to copy encrypted passwords to other systems which don\*(Aqt understand the new algorithm\&. Default is
|
|
\fIno\fR\&.
|
|
.sp
|
|
This variable is superseded by the
|
|
\fBENCRYPT_METHOD\fR
|
|
variable or by any command line option used to configure the encryption algorithm\&.
|
|
.sp
|
|
This variable is deprecated\&. You should use
|
|
\fBENCRYPT_METHOD\fR\&.
|
|
.RE
|
|
.PP
|
|
\fBPASS_MAX_DAYS\fR (number)
|
|
.RS 4
|
|
Максимальное число дней использования пароля\&. Если пароль старее этого числа, то будет запущена процедура смены пароля\&. Если значение не задано, то предполагается значение \-1 (то есть возможность ограничения не используется)\&.
|
|
.RE
|
|
.PP
|
|
\fBPASS_MIN_DAYS\fR (number)
|
|
.RS 4
|
|
Максимальное число дней между изменениями пароля\&. Любая смена пароля ранее заданного срока выполнена не будет\&. Если значение не задано, то предполагается значение \-1 (то есть возможность ограничения не используется)\&.
|
|
.RE
|
|
.PP
|
|
\fBPASS_WARN_AGE\fR (number)
|
|
.RS 4
|
|
Число дней за которое начнёт выдаваться предупреждение об устаревании пароля\&. Нулевое значение означает, что предупреждение выдаётся в день устаревания, при отрицательном значении предупреждение выдаваться не будет\&. Если значение не задано, выдача предупреждения отключается\&.
|
|
.RE
|
|
.PP
|
|
\fBSHA_CRYPT_MIN_ROUNDS\fR (number), \fBSHA_CRYPT_MAX_ROUNDS\fR (number)
|
|
.RS 4
|
|
When
|
|
\fBENCRYPT_METHOD\fR
|
|
is set to
|
|
\fISHA256\fR
|
|
or
|
|
\fISHA512\fR, this defines the number of SHA rounds used by the encryption algorithm by default (when the number of rounds is not specified on the command line)\&.
|
|
.sp
|
|
Увеличение количества раундов повышает сложность подбора пароля простым перебором\&. Но заметим, что при этом для аутентификации пользователей требуется большее количество процессорных ресурсов\&.
|
|
.sp
|
|
Если не задана, то libc выбирает значение количества раундов по умолчанию (5000)\&.
|
|
.sp
|
|
Значения должны лежать в диапазоне 1000\-999999999\&.
|
|
.sp
|
|
If only one of the
|
|
\fBSHA_CRYPT_MIN_ROUNDS\fR
|
|
or
|
|
\fBSHA_CRYPT_MAX_ROUNDS\fR
|
|
values is set, then this value will be used\&.
|
|
.sp
|
|
If
|
|
\fBSHA_CRYPT_MIN_ROUNDS\fR
|
|
>
|
|
\fBSHA_CRYPT_MAX_ROUNDS\fR, the highest value will be used\&.
|
|
.RE
|
|
.PP
|
|
\fBSUB_GID_MIN\fR (number), \fBSUB_GID_MAX\fR (number), \fBSUB_GID_COUNT\fR (number)
|
|
.RS 4
|
|
If
|
|
/etc/subuid
|
|
exists, the commands
|
|
\fBuseradd\fR
|
|
and
|
|
\fBnewusers\fR
|
|
(unless the user already have subordinate group IDs) allocate
|
|
\fBSUB_GID_COUNT\fR
|
|
unused group IDs from the range
|
|
\fBSUB_GID_MIN\fR
|
|
to
|
|
\fBSUB_GID_MAX\fR
|
|
for each new user\&.
|
|
.sp
|
|
The default values for
|
|
\fBSUB_GID_MIN\fR,
|
|
\fBSUB_GID_MAX\fR,
|
|
\fBSUB_GID_COUNT\fR
|
|
are respectively 100000, 600100000 and 65536\&.
|
|
.RE
|
|
.PP
|
|
\fBSUB_UID_MIN\fR (number), \fBSUB_UID_MAX\fR (number), \fBSUB_UID_COUNT\fR (number)
|
|
.RS 4
|
|
If
|
|
/etc/subuid
|
|
exists, the commands
|
|
\fBuseradd\fR
|
|
and
|
|
\fBnewusers\fR
|
|
(unless the user already have subordinate user IDs) allocate
|
|
\fBSUB_UID_COUNT\fR
|
|
unused user IDs from the range
|
|
\fBSUB_UID_MIN\fR
|
|
to
|
|
\fBSUB_UID_MAX\fR
|
|
for each new user\&.
|
|
.sp
|
|
The default values for
|
|
\fBSUB_UID_MIN\fR,
|
|
\fBSUB_UID_MAX\fR,
|
|
\fBSUB_UID_COUNT\fR
|
|
are respectively 100000, 600100000 and 65536\&.
|
|
.RE
|
|
.PP
|
|
\fBSYS_GID_MAX\fR (number), \fBSYS_GID_MIN\fR (number)
|
|
.RS 4
|
|
Range of group IDs used for the creation of system groups by
|
|
\fBuseradd\fR,
|
|
\fBgroupadd\fR, or
|
|
\fBnewusers\fR\&.
|
|
.sp
|
|
The default value for
|
|
\fBSYS_GID_MIN\fR
|
|
(resp\&.
|
|
\fBSYS_GID_MAX\fR) is 101 (resp\&.
|
|
\fBGID_MIN\fR\-1)\&.
|
|
.RE
|
|
.PP
|
|
\fBSYS_UID_MAX\fR (number), \fBSYS_UID_MIN\fR (number)
|
|
.RS 4
|
|
Range of user IDs used for the creation of system users by
|
|
\fBuseradd\fR
|
|
or
|
|
\fBnewusers\fR\&.
|
|
.sp
|
|
The default value for
|
|
\fBSYS_UID_MIN\fR
|
|
(resp\&.
|
|
\fBSYS_UID_MAX\fR) is 101 (resp\&.
|
|
\fBUID_MIN\fR\-1)\&.
|
|
.RE
|
|
.PP
|
|
\fBUID_MAX\fR (number), \fBUID_MIN\fR (number)
|
|
.RS 4
|
|
Range of user IDs used for the creation of regular users by
|
|
\fBuseradd\fR
|
|
or
|
|
\fBnewusers\fR\&.
|
|
.sp
|
|
The default value for
|
|
\fBUID_MIN\fR
|
|
(resp\&.
|
|
\fBUID_MAX\fR) is 1000 (resp\&. 60000)\&.
|
|
.RE
|
|
.PP
|
|
\fBUMASK\fR (number)
|
|
.RS 4
|
|
Задаёт начальное значение маски доступа для создаваемых файлов\&. Если не указано, то маска устанавливается в 022\&.
|
|
.sp
|
|
\fBuseradd\fR
|
|
and
|
|
\fBnewusers\fR
|
|
use this mask to set the mode of the home directory they create
|
|
.sp
|
|
It is also used by
|
|
\fBlogin\fR
|
|
to define users\*(Aq initial umask\&. Note that this mask can be overridden by the user\*(Aqs GECOS line (if
|
|
\fBQUOTAS_ENAB\fR
|
|
is set) or by the specification of a limit with the
|
|
\fIK\fR
|
|
identifier in
|
|
\fBlimits\fR(5)\&.
|
|
.RE
|
|
.SH "ФАЙЛЫ"
|
|
.PP
|
|
/etc/passwd
|
|
.RS 4
|
|
содержит информацию о пользователях
|
|
.RE
|
|
.PP
|
|
/etc/shadow
|
|
.RS 4
|
|
содержит защищаемую информацию о пользователях
|
|
.RE
|
|
.PP
|
|
/etc/group
|
|
.RS 4
|
|
содержит информацию о группах
|
|
.RE
|
|
.PP
|
|
/etc/gshadow
|
|
.RS 4
|
|
содержит защищаемую информацию о группах
|
|
.RE
|
|
.PP
|
|
/etc/login\&.defs
|
|
.RS 4
|
|
содержит конфигурацию подсистемы теневых паролей
|
|
.RE
|
|
.PP
|
|
/etc/subgid
|
|
.RS 4
|
|
Per user subordinate group IDs\&.
|
|
.RE
|
|
.PP
|
|
/etc/subuid
|
|
.RS 4
|
|
Per user subordinate user IDs\&.
|
|
.RE
|
|
.SH "СМОТРИТЕ ТАКЖЕ"
|
|
.PP
|
|
\fBlogin.defs\fR(5),
|
|
\fBpasswd\fR(1),
|
|
\fBsubgid\fR(5), \fBsubuid\fR(5),
|
|
\fBuseradd\fR(8)\&.
|