1. groupadd命令介绍
groupadd用于添加Linux用户组,在Linux系统上是一个常用命令。
2. 添加用户组abc
[root@zcwyou ~]# groupadd abc
3. 将abc组的名字改成qqq
[root@zcwyou ~]# groupmod -n qqq abc
4. 删除组
[root@zcwyou ~]# groupdel abc
5. 查看组
查看当前登录用户所在的组
[root@zcwyou ~]# groups
查看用户zcwyou所属组
[root@zcwyou ~]# groups zcwyou
查看所有组
[root@zcwyou ~]# cat /etc/group
6. 查看帮助
[root@zcwyou ~]# groupadd -h
Usage: groupadd [options] GROUP
Options:
-f,--force
exit successfully if the group already exists,
and cancel -g if the GID is already used
-g, --gid
GID use GID for the new group
-h, --help
display this help message and exit
-K, --key
KEY=VALUE override /etc/login.defs defaults
-o, --non-unique
allow to create groups with duplicate
(non-unique) GID
-p, --password
PASSWORD use this encrypted password for the new group
-r, --system
create a system account
-R, --root
CHROOT_DIR directory to chroot into
7. 总结
groupadd命令用于给Linux系统添加用户组,添加用户组后,还需要把用户添加归属组,与该组映射起来。
评论前必须登录!
注册