Linux 組設定檔(/etc/group),etcgroup

來源:互聯網
上載者:User

Linux 組設定檔(/etc/group),etcgroup

一、概述

Linux 組配置(/etc/group)檔案分為4個欄位,分別為:

組名、組密碼、GID和群組成員。

 

二、樣本

[root@titan ~]# cat /etc/group | grep fruit

fruit:x:1001:

其中,fruit為組名,x為組密碼,1001為GID,群組成員欄位為空白。

使用者apple和banana的預設組為fruit。

[root@titan ~]# id apple

uid=1001(apple) gid=1001(fruit) 組=1001(fruit)

[root@titan ~]# id banana

uid=1002(banana) gid=1001(fruit) 組=1001(fruit)

群組成員欄位為空白時存在2種情況:(1)該組不包含使用者;(2)該組包含使用者,但上述使用者以該組為預設組。

[root@titan ~]# cat /etc/group | grep fruit

fruit:x:1001:

 

三、問題

問題:某使用者顯示在群組成員欄位時,該組是否一定不是此使用者的預設組?

答案:否。

 

使用者apple顯示在組trick的群組成員欄位,組trick是使用者apple的預設組。

[root@titan ~]# cat /etc/group | grep trick

trick:x:1002:apple

[root@titan ~]# id apple

uid=1001(apple) gid=1002(trick) 組=1002(trick)

 

原因分析

建立使用者apple時使其預設組為組fruit,並將其添加至組trick,隨後將使用者apple預設組修改為組trick。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.