User Category:
Administrators group:
Normal Group:
System Group:
General Group
User Group Category:
Private group: Create a user, create a group with the same name by default if the owning group is not specified
Basic group: Default group for users
Additional groups, additional groups: Default groups for other groups
User:
/etc/passwd
Account
passwd
Uid:
Gid:
Comment
HOME DIR:
SHELL:
/etc/shadow
Account
Encrypted password:
User management:
useradd [option] USERNAME
-U UID
-G GID (Basic Group)
-G GID, .... (Additional groups)
-C Comment Information
-D Home Directory
-S SHELL
-m-k
-M do not create home directory
-R Add a system user
/etc/login.defs
Userdel [option] USERNAME
-R: Colleague deletes user's home directory
ID: View user's account attribute information
Usermod
-L: Modify login Name
-L: Lock account
-U: Unlock Account
CHSH: Modifying the user's default shell
CHFN: Modifying annotation information
Password management
passwd [USERNAME]
--stdin standard input Read password
-L
-U
-D Delete User password
PWCK: Checking user account Integrity
Group Management:
To create a group:
Groupadd
-G: Specify GID
-R: Add a system Group
Groupmod
-g:gid
-n:grpname
Groupdel
GPASSWD: Setting a password for a group
NEWGRP: Temporary switch Group (exit exit)
Chage
-D: Most recent modification time
-E: Expiration time
-I: Inactive time
-M: Minimum period of use
-M: Maximum lifespan
-W: Warning time
Rights Management:
Chown: Change file owner (only administrators can use this command)
#chown USERNAME file, ....
-R: Modify the owner of the directory and its internal files
--reference=/path/to/somefile file,... Reference a file, set the same as the reference file
Chown username:grpname file, .... (USERNAME. GRPNAME) Change the genus Group at the same time
#chgrp GRPNAME file, ...
-R: (Recursive)
--reference=/path/to/somefile file,... Reference a file, set the same as the reference file
chmod: Modify permissions for a file
Modify the permissions of the three categories of users;
chmod MODE file, ....
-R: (Recursive)
--reference=/path/to/somefile file,... Reference a file, set the same as the reference file
This article is from "Satan Daily" blog, please make sure to keep this source http://satantiantian.blog.51cto.com/6159537/1568735
Linux Note II: System User Management