Groupadd,groupmod,groupdel How to use
1 ) groupadd
Groupadd Span style= "font-size:19px;font-family: ' Microsoft Jacob Black ', Sans-serif;" > for adding group accounts. The format is as follows: Groupadd[-g GID] group
Where:
group: Is the group name to be added
-g: Used to specify GID, default to use the current largest GID plus 1
Example: Add a new group Leader
# Groupadd leader
# grep Leader/etc/group
leader:x:504:
# grep Leader/etc/gshadow
leader:!::
) Groupmod
Groupmod
3 ) Groupdel
Groupdel is used to delete a group account that already exists on the system. The format is as follows: Groupdelgroup
Where: Group is the account name to be deleted
Example: Deleting a leaders Group
# Groupdel Leaders
# grep Leaders/etc/group
# grep Leaders/etc/gshadow
gpasswd How to use commands
Features: Administrative Groups
Usage: gpasswd[-a user][-d user][-a user,...] [-muser,...] [-R] [-r]groupname
Parameters:
-A: Adding users to Groups
-D: Remove a user from a group
-A: Specify administrator
-M: Specifies that the group member and-a use almost
-R: Remove password
-r: Restrict user login group, only members in group can join the group with NEWGRP
Gpasswdgroupname : If the system has a Peter account, the account itself is not a member of the GroupName group, use NEWGRP need to enter a password
Let the user temporarily join the group, and then the file group created by Peter will be groupname. So this way you can temporarily let Peter build the text
Use other groups instead of the one in which Peter itself is a part.
So use gpasswd groupname to set the password, that is, people who know the group password can temporarily switch to have GroupName group function.
Gpasswd-a Peter Users
So that Peter is the administrator of the Users group, you can do the following:
Gpasswd-a Mary Users
Gpasswd-a Allen Users
* after setting the password for the group account, the user login system, use the NEWGRP command, enter the password set for the group account, you can temporarily add to the specified group, you can manage group users, with group permissions. Format: Newgrp
"group name"
This article from "Peng Brother's Blog" blog, declined reproduced!
Linux command Groupadd commands, groupmod commands, Groupdel commands, and GPASSWD commands