1. Introduction command
groupadd command is a command system administrator to create a new group.
groupadd command creates a new group account using the values specified on the command line and the default values in the system. The new group will be added to the system files as needed.
2. Command Format
groupadd [OPTIONS] GROUP
3. Common Options
-f, --force
如果组已经存在则成功退出并且如果 GID 已经存在则取消 -g
-g, --gid GID
为新组使用 GID
-h, --help
显示帮助信息并推出
-K, --key KEY=VALUE
不使用 /etc/login.defs 中的默认值
-o, --non-unique
允许创建有重复 GID 的组
-p, --password PASSWORD
为新组使用加密过的密码
-r, --system
创建一个系统组
Reference Example 4
(1) Add a user group.
groupadd g1
(2) add a specified user group and GID.
groupadd -g 888 g2
(3) using the -r Create a system working group.
groupadd -r -g 889 g3
(4) allows the creation of duplicate GID of the group.
groupadd -o -r -g 889 g4
#查看新创建的用户组
tail -n 3 /etc/group
g2:x:888:
g3:x:889:
g4:x:889:
(5) using the encrypted password for the new group.
groupadd -p $6$6B3fQyRr$DWk9/i2ly/8IFNA8lNReCAve6eODSGuvOD2Y2q/NGZXGgaQ9j/APs0TpA3b5nPg2VcuDyHVCz.d8zpeJYJar./ g5
5. Related Documents
/etc/group #群组信息
/etc/gshadow #群组加密信息
references
[. 1] the groupadd (. 8) Manual
[2] . [Linux] CSDN step by step to learn Linux - groupadd command (87)