#组帐号管理
Linux Group Management
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
1. Classification of groups
Private group: Can contain only one user (created automatically by the user who created it)
Standard group: can contain multiple users
2. Groups of information
Group name: identification symbol for a group
GID: A member of the group's unique identifier password group
3. Management of Groups
File/etc/group Features:
Storage System Group Information content: g1:x: 500:u1,u2,u3
4. Administrative Tools for group accounts
1) Set up a group
Format: groupadd [parameter] group name
Parameters:
-G GID: Specifies the value of the GID
-R: Establish system user Group 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 as
Defined in/etc/login.defs, if no GID is specified.
2) Delete Group
Format: Guoupdel Group name
Example: Guoupdel G3
3) Modify the information for the group
Format: groupmod [parameter] group name
Parameters:
-N New group name: Modify Group GID
-G GID: Modifying the group's GID
-a username adding users to groups
-r Username Delete user from group
Instance:
1) # Groudmod-n Group G1
2) # Groupmod-g 860 U1,U2
4) Change Password
Format: gpasswd [parameter] group name
Parameters:
-A user name: Add users to the specified group
-D user name: Removes the user instance from the specified group:
1) #gpasswd-a U1 root
2) #gpasswd-D U1 Root
5) display the group to which the user belongs
Format: Groups [user name]
Instance:
1) #groups (displays the group to which the current user belongs)
2) #groups root (displays the group to which the root user belongs)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
Example: Groupadd [-R] GroupName
-r option to create a system group
1. Create a user group Tata
Groupadd Tata
2. Create a group with initial password Tata
Groupadd-p $ (OpenSSL passwd-1-salt "Tata" Tata) Tata
3. Modify the group password
[Email protected]_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
[Email protected]_39_184_sles10:/usr# groupmod-a Tata Tata
[Email protected]_39_184_sles10:/usr# ID Tata
uid=1005 (Tata) gid=100 (users) groups=100 (users), 1005 (Tata)
5. Delete User Tata to group Tata
[Email protected]_39_184_sles10:/usr# groupmod-r Tata Tata
[Email protected]_39_184_sles10:/usr# ID Tata
uid=1005 (Tata) gid=100 (users) groups=100 (users)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
Tools or commands for managing user groups (group);
Groupadd Note: Add user group;
GPASSWD Note: Set the group password; After you create a new group, you typically call this setting group password
Groupdel Note: delete user group;
Groupmod Note: Modify user group information
Groups Note: Displays the user group to which the user belongs
Grpck
GRPCONV Note: Synchronize or create/etc/gshadow with the file contents of/etc/group and/etc/gshadow, or create if/etc/gshadow does not exist;
Grpunconv Note:/etc/group and/etc/gshadow file content to synchronize or create/etc/group, and then delete the Gshadow file;
Centos User Group Management