The main user Group configuration files are /etc/group and /etc/gshadow, where /etc/gshadow is the encrypted information file of /etc/group.

/etc/groupThe file function

/etc/groupThe file is the configuration file of the user group, including the user and the user group, and can show which user group or several user groups the user belongs to, because a user can belong to one or more different user groups; Users in the same user group have similar characteristics. For example, if we add a user to the root group, then the user can browse the files in root’s home directory. If root opens access to read and write execution of a file, all users in the root group can modify the file. If it is an executable file (such as a script), Users of the root user group can also execute; User group features in the system management for the system administrator to provide a great convenience, but security is also worth paying attention to, such as a user under the system management has the most important content, it is best to let the user have an independent user group, or the user under the file permissions set as completely private; In addition, the root user group should not be easily joined by ordinary users.

/etc/groupThe file format

/etc/groupThe contents of the User Group, the password of the User Group, the GID, and the users contained in the User Group. Each User Group has one record

group_name:passwd:GID:user_list

  • First field (group_name) : user group name;
  • Second field (passwd) : user group password;
  • Third field :GID
  • Fourth field (user_list) : user list, each user is divided by, number; This field can be empty; If the field is empty, it means the username with the user group GID

Let me give you an example.

root:x:0:root,adminNote: The user group root (x is the password segment) has no password set, and the GID is 0. The user group root includes root, admin, and other users with a GID 0 (you can view it through /etc/passwd).

What is the GID

A GID is a positive integer or 0, similar to a UID. Groups with a GID starting at 0 are assigned to the root user group. Some of the higher GIDs are reserved for virtual users (also known as camouflage users); The default GID range for a user group should look at the GID_MIN and GID_MAX values in /etc/login.defs.

The original link: https://rumenz.com/rumenbiji/… WeChat official account: entry station