Describes the Linux User Group Management Solution in detail.

Source: Internet
Author: User

In Linux system management, the Linux User Group management solution is to manage a group of users. Different Linux systems have different user groups. For example, a user in Linux belongs to a user group with the same name as a user group, which is created at the same time. User Group management involves adding, deleting, and modifying user groups. The addition, deletion, and modification of a group are actually updates to the/etc/group file.

1. Add a new user group to use the groupadd command. The format is as follows:
Groupadd option User Group
You can use the following options:
-GGID: Specifies the group id gid of the new user group ).
-O is generally used together with the-g option, indicating that the GID of the new user group can be the same as the GID of the existing user group in the system.] Example 1:
# Groupaddgroup1 this command adds a new group group1 to the system. The Group ID number of the new group is added with 1 on the basis of the current largest group ID number.
Example 2:
# Groupadd-g101group2
This command adds a new group group2 to the system and specifies that the Group ID of the new group is 101.

2. to delete an existing user group, run the groupdel command in the following format:
Groupdel User Group
For example:
# Groupdelgroup1
This command deletes group group1.

3. Run The groupmod command to modify the attributes of a user group. The syntax is as follows:
Groupmod option User Group
Common options include:
-GGID: specify a new group ID for the user group.
-O and-g options are used at the same time. The new GID of a user group can be the same as the GID of an existing user group in the system.
-N new user group: Change the user group name to a new name.
Example 1:
# Groupmod-g102group2
This command changes the group ID of group group2 to 102.
Example 2:
# Groupmod-g10000-ngroup3group2
This command changes the ID of group group2 to 10000 and the group name to group3.

4. If a user belongs to multiple user groups at the same time, the user can switch between user groups to have permissions for other user groups. After logging on, you can use the newgrp command to switch to another user group. The parameter of this command is the target user group. For example:
$ Newgrproot
This command switches the current user to the root user group, provided that the root user group is indeed the user's main group or additional group. Similar to user account management, user group management can also be completed through integrated system management tools.

The Linux User Group management solution solves the problem of disabling members of a group at the same time.

  1. Use of Linux kernel Security Intrusion Detection System
  2. Detailed analysis of Linux folder execution Permissions
  3. How to check Linux Security Vulnerabilities
  4. Overall summary of changes in Linux shell output
  5. In-depth analysis of Linux partition Basics

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.