Linux Add user Group

Source: Internet
Author: User


Etc directory there are two files under one passwd a group
passwd GID is the primary group, the other groups are extension groups, and the extension groups are described in/etc/group.
Useradd username if not specified, a GID with the same UID is created by default.
Other groups can be added to other groups by-G when creating users, or they can be modified with usermod-g groupname username for existing users.

For example, the primary group for User1 is 500, and the expansion group is 501 and 502
The primary group of the User2 is 501, and the expansion group is 502
The main group of User3 is 502

The passwd format is as follows:
User1:x:500:500::/home/user1:/bin/bash
User2:x:501:501::/home/user2:/bin/bash
User3:x:502:502::/home/user3:/bin/bash

The group format is as follows:
USER1:X:500:
User2:x:501:user1
User3:x:502:user1,user2

Linux Add user Group

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.