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