# Group Account Management
Linux Group Management
=- =-= -- =
1. group classification
Private Group: Only one user can be included (automatically created by the created user)
Standard group: can contain multiple users
2. Group Information
Group Name: Group Identifier
GID: a member of the password group with the unique identifier of the group.
3. Group Management
File/etc/group function:
System group information: g1: x: 500: u1, u2, u3
4. group account management tools
1) create a group
Format: groupadd [parameter] group name
Parameters:
-G GID: Specifies the value of GID.
-R: Create a system user group
Instance:
1) # groupadd g2
2) # groupadd-r g3
Create a system group. A system group is an entry with an GID between SYSTEM_GID_MIN and SYSTEM_GID_MAX
Defined in/etc/login. defs, if no GID is specified.
2) delete a group
Format: guoupdel group name
Instance: guoupdel G3
3) Modify group information
Format: groupmod [parameter] group name
Parameters:
-N new group name: Modify the GID of the Group
-G GID: Modify the GID of the group.
-A username: Add A user to the group
-R username: delete a user's slave Group
Instance:
1) # groudmod-n group g1
2) # groupmod-g 860 u1, u2
4) change the password
Format: gpasswd [parameter] group name
Parameters:
-A User name: Add users to a specified group
-D User name: delete a user instance from a specified group:
1) # gpasswd-a u1 root
2) # gpasswd-d u1 root
5) display the user group
Format: groups [user name]
Instance:
1) # groups (display the group to which the current user belongs)
2) # groups root (display the group of the root user)
=- =-= -- =
Instance: groupadd [-r] groupname
-R option: Create a system group
1. Create a user group tata
Groupadd tata
2. Create a group with the initial password tata
Groupadd-p $ (openssl passwd-1-salt "tata" tata) tata
3. Change the group password
Root @ OP_39_184_sles10:/usr # gpasswd tata
Changing the password for group tata.
New Password:
Re-enter new password:
Password changed.
4. Add the user tata to the group tata
Root @ OP_39_184_sles10:/usr # groupmod-A tata
Root @ OP_39_184_sles10:/usr # id tata
Uid = 1005 (tata) gid = 100 (users) groups = 100 (users), 1005 (tata)
5. delete user tata to group tata
Root @ OP_39_184_sles10:/usr # groupmod-R tata
Root @ OP_39_184_sles10:/usr # id tata
Uid = 1005 (tata) gid = 100 (users) groups = 100 (users)
=- =-= -- =
Tools or commands used to manage user groups;
Groupadd Note: Add a user group;
Gpasswd Note: Set the group password. This setting group password is generally called after a new group is created.
Groupdel Note: delete a user group;
Groupmod Note: Modify user group information
Groups Note: displays the user group to which the user belongs.
Grpck
Note: Use the/etc/group and/etc/gshadow file content to synchronize or create/etc/gshadow. If/etc/gshadow does not exist, create it;
Grpunconv Note: Use the/etc/group and/etc/gshadow file content to synchronize or create/etc/group, and then delete the gshadow file;