groupadd [options] group Options
选项
-f,--force
|
如果指定的组已经存在,则此选项使命令以成功状态退出。与-g一起使用时,并且指定的GID已经存在,则选择另一个(唯一的)GID(即-g已关闭)。
|
-g,-- gid GID
|
组ID的数值。除非使用-o选项,否则该值必须唯一。该值必须为非负数。默认设置是使用大于或等于GID_MIN且大于其他所有组的最小ID值。
另请参见-r选项和GID_MAX描述。
|
-h,--help
|
显示帮助消息并退出。
|
-K,-- key KEY = VALUE
|
覆盖/etc/login.defs的默认值(GID_MIN,GID_MAX等)。可以指定多个-K选项。
示例:-K GID_MIN = 100 -K GID_MAX = 499
|
-o, --non-unique
|
此选项允许添加具有非唯一GID的组。
|
-p,-- password PASSWORD
|
该加密的 密码,由返回的crypt()系统调用。默认为禁用密码。
注意:不建议使用此选项,因为列出进程的用户将看到密码(或加密的密码)。您应该确保密码遵守系统的密码策略。
|
-r,--system
|
创建一个系统组。新系统组的数字标识符是在login.defs中定义的SYS_GID_MIN-SYS_GID_MAX范围中选择的,而不是GID_MIN-GID_MAX。
|
-R,--root CHROOT_DIR
|
在应用更改CHROOT_DIR目录,并从使用配置文件CHROOT_DIR目录。另请参阅chroot。
|
结构
/etc/login.defs中的以下配置变量更改了此工具的行为:
GID_MAX (数字),GID_MIN (数字)
useradd,groupadd或newusers用于创建常规组的组ID范围。GID_MIN(分别为GID_MAX)的默认值为1000(分别为60000)。
MAX_MEMBERS_PER_GROUP (数字)
每个组条目的最大成员数。当达到最大值时,将在/ etc / group中启动一个新的组条目(行)(具有相同的名称,相同的密码和相同的GID)。默认值为0,表示组中的成员数量没有限制。此功能(拆分组)允许限制组文件中的行长。确保NIS组的行不超过1024个字符非常有用。如果您需要强制执行此限制,则可以使用25。注意:并非所有工具都支持拆分组(即使在Shadow工具套件中也是如此)。除非确实需要,否则不应使用此变量。
SYS_GID_MAX (数字),SYS_GID_MIN (数字)
useradd,groupadd或newusers用于创建系统组的组ID范围。SYS_GID_MIN的默认值(分别为SYS_GID_MAX)为101(分别为GID_MIN-1)。
groupadd [options] group
Options
-f, --force
|
This option causes the command to exit with success status if the specified group already exists. When used with -g, and the specified GID already exists, another (unique) GID is chosen (i.e. -g is turned off).
|
-g, --gid GID
|
The numerical value of the group's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The default is to use the smallest ID value greater than or equal to GID_MIN and greater than every other group.
See also the -r option and the GID_MAX description.
|
-h, --help
|
Display help message and exit.
|
-K, --key KEY=VALUE
|
Overrides /etc/login.defs defaults (GID_MIN, GID_MAX and others). Multiple -K options can be specified.
Example: -K GID_MIN=100 -K GID_MAX=499
|
-o, --non-unique
|
This option permits to add a group with a non-unique GID.
|
-p, --password PASSWORD
|
The encrypted password, as returned by the crypt()system call. The default is to disable the password.
Note: This option is not recommended because the password (or encrypted password) will be visible by users listing the processes. You should make sure the password respects the system's password policy.
|
-r, --system
|
Create a system group. The numeric identifiers of new system groups are chosen in the SYS_GID_MIN-SYS_GID_MAX range, defined in login.defs, instead of GID_MIN-GID_MAX.
|
-R, --root CHROOT_DIR
|
Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. See also chroot.
|
Configuration
The following configuration variables in /etc/login.defs change the behavior of this tool:
GID_MAX (number), GID_MIN (number)
Range of group IDs used for the creation of regular groups by useradd, groupadd, or newusers. The default value for GID_MIN (resp. GID_MAX) is 1000 (resp. 60000).
MAX_MEMBERS_PER_GROUP (number)
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). The default value is 0, meaning that there are no limits in the number of members in a group. 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. If you need to enforce such limit, you can use 25. 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.
SYS_GID_MAX (number), SYS_GID_MIN (number)
Range of group IDs used for the creation of system groups by useradd, groupadd, or newusers. The default value for SYS_GID_MIN (resp. SYS_GID_MAX) is 101 (resp. GID_MIN-1).