# Group account management linux group management =-= -= 1. classification private group: only one user can be included (automatically created by the created user) Standard Group: can contain multiple users 2. information group name of the group: GID of the group: a member of the group's unique identifier password group 3. manage group files/# manage group accounts
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;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.