Centos 使用者組管理

來源:互聯網
上載者:User

標籤:

#組帳號管理


linux 組管理
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=


1.組的分類
私用組:只能包含一個使用者(由建立使用者的自動建立)
標準組:可以包含多個使用者


2.組的資訊
組名:組的標識符號
GID:組的唯一識別碼口令組的成員


3.組的管理
檔案/etc/group功能:
存放系統組資訊內容: g1: x : 500 :u1,u2,u3


4.組帳號的管理工具


1)建立組
格式:groupadd [參數] 組名
參數:
-g GID :指定GID的值
-r :建立系統使用者組組


執行個體:
1)# groupadd g2
2)# groupadd –r g3
Create  a  system  group.  A  system group is an entry with an GID between SYSTEM_GID_MIN and SYSTEM_GID_MAX as
defined in /etc/login.defs, if no GID is specified.


2)刪除群組
格式:guoupdel 組名
執行個體:guoupdel G3


3)修改組的資訊
格式:groupmod [參數] 組名
參數:
        -n 新組名:修改組的GID  
  -g GID:修改組的GID
        -A username 添加使用者到組
        -R username 刪除使用者從組
執行個體:
1)# groudmod -n group g1
2)# groupmod -g 860 u1,u2


4)修改密碼
格式:gpasswd [參數] 組名
參數:
-a 使用者名稱 : 向指定組添加使用者
-d 使用者名稱 : 從指定組中刪除使用者執行個體:
1)#gpasswd -a u1 root
2)#gpasswd -d u1 root


5)顯示使用者所屬組
格式:groups [使用者名稱]
執行個體:
1)#groups (顯示目前使用者所屬組)
2)#groups root (顯示root使用者的所屬組)




=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
執行個體:groupadd  [-r] groupname 


-r 選項建立系統組


1.建立使用者組tata 
 groupadd  tata


2.帶初始密碼建立組tata
groupadd -p $(openssl passwd -1 -salt "tata" tata) tata


3.修改組密碼
[email protected]_39_184_sles10:/usr# gpasswd tata
Changing the password for group tata.
New Password: 
Re-enter new password: 
Password changed.


4.添加使用者tata到組tata
[email protected]_39_184_sles10:/usr# groupmod -A tata tata
[email protected]_39_184_sles10:/usr# id tata
uid=1005(tata) gid=100(users) groups=100(users),1005(tata)


5.刪除使用者tata到組tata
[email protected]_39_184_sles10:/usr# groupmod -R tata tata
[email protected]_39_184_sles10:/usr# id tata
uid=1005(tata) gid=100(users) groups=100(users)




=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
系統管理使用者組(group)的工具或命令;
groupadd  註:添加使用者組;
gpasswd   註:設定組密碼;新群組後一般要調用這個設定組密碼
groupdel  註:刪除使用者組;
groupmod  註:修改使用者組資訊
groups    註:顯示使用者所屬的使用者組
grpck
grpconv   註:通過/etc/group和/etc/gshadow 的檔案內容來同步或建立/etc/gshadow ,如果/etc/gshadow 不存在則建立;
grpunconv 註:通過/etc/group 和/etc/gshadow 檔案內容來同步或建立/etc/group ,然後刪除gshadow檔案;

Centos 使用者組管理

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.