Linux常用基本命令-使用者組管理命令
阿新 • • 發佈:2018-11-25
使用者組管理命令
每個使用者都有一個使用者組,系統可以對一個使用者組中的所有使用者進行集中管理。不同Linux 系統對使用者組的規定有所不同,
如Linux下的使用者屬於與它同名的使用者組,這個使用者組在建立使用者時同時建立。
使用者組的管理涉及使用者組的新增、刪除和修改。組的增加、刪除和修改實際上就是對/etc/group檔案的更新。
一、groupadd 新增組
1.基本語法
groupadd 組名
2.案例實操
(1)新增一個xitianqujing組
[[email protected] opt]#groupadd xitianqujing
二、 groupdel 刪除組
1.基本語法
groupdel 組名
2.案例實操
(1)刪除xitianqujing組
[[email protected] opt]# groupdel xitianqujing
三、 groupmod 修改組
1.基本語法
groupmod -n 新組名 老組名
2.選項說明
選項 | 功能描述 |
---|---|
-n<新組名> | 指定工作組的新組名 |
3.案例實操
(1)修改bigdata組名稱為bigdata1
[[email protected] ~]#groupadd xitianqujing
[[email protected]doop101 ~]# groupmod -n xitian xitianqujing
四、 cat /etc/group 檢視建立了哪些組
1.基本操作
[[email protected] bigdata]# cat /etc/group