Linux command Groupadd commands, groupmod commands, Groupdel commands, and GPASSWD commands

Source: Internet
Author: User

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

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.