Linux System Command Learning Series-User group management

Source: Internet
Author: User

Let's review the previous section:

    1. Set password command passwd
    2. User Information Modify Command usermod
    3. User Delete command Userdel
    4. Job: Modify User1 User ID 505, home directory to admin, user Group for admin, and finally delete user1 user

Usermod–u 505–d/home/admin–g Admin User1

Userdel user1

In this section, we continue to talk about user management-related commands

1. Add User group Groupadd

The use of this command is simple groupadd groupname

After the addition is complete, you can view the group information in the/etc/group file

You can see that the ID of group1 is 1001, and we can specify the-G parameter to specify the ID of the group

Let's say we create a new group2 group with ID 501.

GROUPADD–G 501 Group2

View in/etc/group

2. Modify User Group Groupmod command

This command allows you to modify the ID and name of the group, using the-G and-N parameters respectively

For example, we want to change the ID of group1 to 502, the name is Group3

Groupmod–g 502–n Group3 group1

View Results

3. Delete user group Groupdel

The application is simple, you can delete the specified group by specifying the group name, such as deleting the group2 group

Groupdel group2

View group information and discover that group2 does not exist.

Ridoven please pay attention to the public number "kick genius"

Linux System Command Learning Series-User group management

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.