码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 组配置文件(/etc/group)

时间:2017-08-11 21:10:26      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:apple   原因分析   创建用户   trick   不包含   etc   linux   配置文件   app   

一、概述

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。

 

Linux 组配置文件(/etc/group)

标签:apple   原因分析   创建用户   trick   不包含   etc   linux   配置文件   app   

原文地址:http://www.cnblogs.com/apricot/p/7347807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!