/etc/group文件格式说明

今晚折腾在centos搭建nginx。在看group的时候发现文档的格式看不懂,于是get到新知识了。

///////////////////////////////////////////////////////////////////////////

1–Understanding /etc/group File

首先group是用来存储描述组信息的文件。

Users can be either people (meaning accounts tied to physical users) or accounts which exist for specific applications to use.用户可以是人,也可以是为某些特殊应用而设立的。

Groups are logical expressions of organization, tying users together for a common purpose. Users within a group can read, write, or execute files owned by that group.组则是将一些有相同需求的用户联系在一起。

——

Chapter 33. Users and Groups

2–/etc/group格式说明

group有四部分,每部分用分号:分割。

四个部分分别是:

  1. group_name: It is the name of group. If you run ls -l command, you will see this name printed in the group field.
  2. Password: Generally password is not used, hence it is empty/blank. It can store encrypted password. This is useful to implement privileged groups.
  3. Group ID (GID): Each user must be assigned a group ID. You can see this number in your /etc/passwd file.
  4. Group List: It is a list of user names of users who are members of the group. The user names, must be separated by commas.

======================================

查看某用户所在的组:$groups username

发表评论

电子邮件地址不会被公开。 必填项已用*标注