Linux System User Group management

Source: Internet
Author: User

Linux System User Group management

Linux supports user groups, which are collections of users with the same characteristics; A group can contain multiple users, and each user can also belong to a different group user group to logically organize user accounts together, which allows the user to share files within the group. Each file on the system has one user and one group owner; use the ls–l command to see the host and group of each file. (User groups play an important role in Linux, allowing administrators to centrally manage users).

1. The Linux User group is divided into the following two categories:

Private groups: Groups created automatically when a user is created

Standard Group: A group that can contain multiple users

2, the data file of the group/etc/group

Function: Store System Group information

Format: User group name: Password: Administrator of user group: List of Members

Cases:

3, the data file of the group/etc/gshadow

The/etc/gshadow file is used to define user group passwords, group administrators, and so on, which can only be read by the root user.

Cases:

Format: Group name: encrypted password: Group Manager: Group member

Explain:

Group name: identification symbol for a group

Encrypted password: if "!!" is displayed, this group does not have a password.

Group Manager: The right to add and remove users from this group.

Members of a group: separated by "," between multiple member names.

4. Management of group account

(1) Set up a group

Format: #groupadd [options] Group name

Parameters:

- G GID //Specify GID value for new group

Cases:

To see if the build was successful:

(2) Delete a group

Format: #groupdel Group name

Cases:

See if a group has been deleted:


(3) Modify the information of the group

Format:

#groupmod [Options] Group name

Options:

-N New group name original group name//modify Group name

- G GID //Modify the GID of the group

Cases:

To see if the success has been modified:



(4) Add/Remove group members, or change group password

Format:

#gpasswd [Options] [user name] [group name]

Options:

-a username//Add a user to the specified group

-D user name//remove user from specified group

-r//Remove group password

Cases:

To see if a success has been added:



(5) Displays the group to which the user belongs

Format: #groups [user name]

Cases:


Linux System User Group management

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.