II: Linux Users and user groups

Source: Internet
Author: User

Linux is a multi-user system, no time there are many accounts on the system login, operation, so it is important to manage users.

1. User article--/etc/passwd,/etc/shadow

1. Add Account--useradd

< Span class= "Pre" > Useradd [-u uid] [-g gid] [-d home] [-m] Span class= "Pre" >[-s]

Add account and can customize parameters according to their own needs, such as can be set owner (-u uid), group (-G GID), home directory (-D home), not home directory (-m), custom shell (-s)

For example, I create a new account Cqsxxy

When a new account is created, there will be information about the account in the system.

/ETC/PASSWD: Store account information

/etc/shadow: Store account password

  

2. Delete Account--userdel

  userdel [-r] 账号名

Deleting an account is easy, justuserdel [-r] 账号名就将账号从系统中删掉了,但是要注意一定要加上-r选项,不然就会删不干净,如下

Without the-r parameter, only the account information in the/etc/passwd and/etc/shadow files will be erased.

And the information in the home directory is still there, so there will be a risk of errors, so be sure to delete the clean.

2. User group--/etc/group,/etc/gshadow

User groups, like users, also have Groupadd (add Group), Groupdel (delete group)

  

Sometimes if the group contains an account, you cannot delete the group, you must delete the account before deleting the group.

/etc/group: Saving Group information

/etc/gshadow: Save Group password

II: Linux Users and user groups

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.