Both the Linux/etc/group file and the/etc/passwd and/etc/shadow files have files related to the management of users and user groups by the system administrator. Linux/etc/group files are files that the system administrator manages for users and user groups, and all the information for the Linux user group is stored in the/etc/group file. A user group is a collection of users with a common attribute. The user group profile mainly has/etc/group and/etc/gshadow, where/etc/gshadow is the/etc/group encrypted information file.
Grouping users makes it a means of managing and controlling access to users in a Linux system. Each user belongs to a group of users, a group can have multiple users, and a user can belong to a different group. When a user is a member of more than one group at the same time, the primary group that the user belongs to is recorded in the/etc/passwd file, which is the default group to which the login belongs, and the others are additional groups.
All the information for the user group is stored in the/etc/group file. The format of this file is separated by a colon (:) Number of fields, which are as follows:
Group Name: password: Group identification number: List of users in the group
Specific explanations:
Group Name:
The group name is the name of the user group, consisting of letters or numbers. As with logins in/etc/passwd, group names should not be duplicated.
Group Identification Number:
The group identification number is similar to the user identification number and is an integer that is used internally by the system to identify the group. Alias Gid.
List of users in the group:
is a list of all users belonging to this group, separated by commas (,) between different users. This user group may be the user's primary group, or it may be an additional group.
Usage examples:
The Root:x:0:root,linuxsir user group root,x is a password segment, which means that no password is set, and GID is another user under the 0,root user group that includes root, Linuxsir, and GID 0.
Every day a Linux command (+)--/etc/group file details