Linux uses /etc/group file to manage user methods

  

What is the /etc/group file, and what does the /etc/group file do? In fact, the /etc/group file in the Linux system is mainly used to store the information of the user group. It needs to be managed regularly. The following system home introduces you to the method of managing users through the /etc/group file in Linux. Let's take a look at it. User

have some common features set up as a user group (Group). The user group configuration files mainly include /etc/group and /etc/gshadow, where /etc/gshadow is the encrypted information file of /etc/group.

Grouping users is a means of managing and controlling access to users in a Linux system (see How the System Home restricts access to Linux users). Each user belongs to a user group; there can be multiple users in a group, and one 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, which is the default group to which the login belongs, and the other groups are called additional groups.

All information about the user group 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: User list in the group

Specific explanation: Br>

Group Name:

The group name is the name of the user group and consists of letters or numbers. As with the login name in /etc/passwd, the group name should not be duplicated.

Password:

The password field stores the encrypted password of the user group. Generally, the user group of the Linux system does not have a password, that is, this field is generally empty or *.

Group ID:

The group ID is similar to the user ID and is an integer that is used internally by the system to identify the group. Nicknamed GID.

Group User List:

is a list of all users belonging to this group, separated by commas (,). This user group may be the user's primary group or an additional group.

Use case:

Output:

The 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

The above is the way Linux uses the /etc/group file to manage users, because all user information is in this file, if you want to manage users, you can Open the /etc/group file for management.

Copyright © Windows knowledge All Rights Reserved