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 is a file on which the system administrator manages users and user groups.
A user Group is a collection of users with some common features ). The user Group configuration files include/etc/group and/etc/gshadow./etc/gshadow is the encrypted information file of/etc/group.
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.
All user group information is stored in the/etc/group file.The format of this file is separated by a colon (:). The fields are as follows:
Group name: Password: group ID: Group user list
Explanation:
Group name:
The 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.
Password:
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 *.
Group ID:
The group ID is similar to the user id. it is also an integer used internally to identify the group. GID.
Group User list:
Is a list of all users in this group. different users are separated by commas. This user group may be the user's primary group or an additional group.
Instance used:
Output:
Copy codeThe code is as follows:
[Root @ localhost test6] # cat/etc/group
Root: x: 0: root, linuxsir
Bin: x: 1: root, bin, daemon
Daemon: x: 2: root, bin, daemon
Sys: x: 3: root, bin