User Management for Linux Learning

Source: Internet
Author: User

Although we entered our account when logging on to Linux, the Linux host does not directly know your account name. He only knows the ID, the relationship between your ID and your account is in/etc/passwd.

 

Each login user has at least two IDs, one being the user ID and the other being the user group ID,

The ID information is mainly stored in/etc/passwd and/etc/group. Interested readers can view it by themselves.

 

Add and delete users:

Useradd

Useradd [-u uid] [-g gid] [-D main folder Directory] account name

Useradd Aviva

Add a password to a user

Passwd Aviva

In this way, the user is added.

 

 

Delete a user

Userdel-r Aviva

Delete with the user's main folder

 

 

Add a user group

Groupadd [-g gid] [-R] User Name

-G is followed by a specific GID,

-R: Create a system user group

Create a user group named group1

Groupadd group1

 

Delete a user group

Groupdel group1

 

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.