Detailed introduction to Linux/etc/group files

Source: Internet
Author: User

Both the Linux/etc/group file and the/etc/passwd and/etc/shadow files contain files related to the system administrator's management of users and user groups, the Linux/etc/group file has less content than the other two files. Here, the file is analyzed as follows.

All user group information is stored in the/etc/group file.

Grouping users is a way to manage users and control access permissions in Linux. Each user belongs to a user group. A group can contain multiple users, and a user can belong to different groups. When a user is a member of multiple groups at the same time, the main group to which the user belongs is recorded in the/etc/passwd file, that is, the default group to which the user belongs during logon, other groups are called additional groups.

To access files in an additional group, you must first use the newgrp command to make yourself a member of the group to be accessed. All user group information is stored in the/etc/group file. The format of this file is also similar to the/etc/passwd file. Several fields are separated by colons (:). These fields include:

Group Name: Password: Group ID: group user list
1) "group name" is the name of the user group, which consists of letters or numbers. Same as the login name in/etc/passwd, the group name should not be repeated.
2) The "password" field stores the encrypted password of the user group. Generally, users in Linux do not have a password, that is, this field is generally blank, or *.
3) the "Group ID" is similar to the user ID and is also an integer used internally to identify the group.
4) The "group user list" is a list of all users in this group/B]. Different users are separated by commas. This user group may be the user's primary group or an additional group.
An example of the/etc/group file is as follows:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.