Click on the input picture description
A, Linux user group concept
Linux Users Group (group) have the same operation is purview of Linux to manage user;
For example, sometimes we have to let the same class of users have the same permissions, such as view, modify a file or execute a command,
Then we need to define user groups, and then similar to the user-defined user group, and then by modifying the file or directory permissions,
So that the group has a predetermined range of the operation right, so that the file or directory corresponding to the user under the user group have the same privileges,
By way of a user group we can achieve the same kind of unified user management. You can protect the security of the system by controlling purview.
Second, the commonly used commands
1, the new user group
Format: groupadd options User Group
Options Parameter Description:
-g GID Specifies the group ID (GID) of the new user group.
-o -g option is generally used in conjunction with, the new group represents the GID may be the same GID system existing user groups.
Example:
groupadd group1 # group1 a new user group will be based on the system default GID largest GID + 21
groupadd -g 106 group2 # group1 a new user group GID 106
2, delete a user group
Examples
groupdel group1 # delete user group group1
3, modify user groups
Format: groupmod options User Group
Options Parameter Description:
-g GID Specifies the new group ID for the user group.
-o -g option while using the new GID user group can have the same GID system user group.
-n new user group to change the name of the user group
Example:
groupmod -g 107 group2 # 107 modified group2 GID,
groupmod -g 10000 -n group3 group2 # group2 group name will be changed to group3.GID 10000
Third, the user group information storage location
Default / etc / group user group information storage
cat / etc / group # can view
View etc / group
Reproduced in: https: //www.jianshu.com/p/853fde9bf0bc