1, Build Users:
AddUser PHPQ//New PHPQ User
passwd PHPQ//Set Password to PHPQ user
2, the establishment of the Working Group
Groupadd test//New test Workgroup
3, new users to increase the team at the same time
USERADD-G test PHPQ//new PHPQ user and add to test workgroup
Note:: The shell used by the group-D home Directory-S for-G
4, to the existing user to increase the Working group
USERMOD-G groupname username
Or: Gpasswd-a user Group
5, temporary shutdown: In the/etc/shadow file belongs to the user's line of the second field (password) before adding * on it. To restore the user, remove the * can.
Or, use the following command to close the user account:
passwd peter–l
Re-release:
passwd Peter–u
6. Permanently delete user account
Userdel Peter
Groupdel Peter
Usermod–g Peter Peter (forcibly deletes all files and subdirectories under this user's home directory and home directory)
7, remove users from the group
Edit/etc/group Find GROUP1 line, delete A or use command gpasswd-d a group
8. Display user Information
ID User
cat/etc/passwd
Add: Ways to view users and user groups
User list file:/etc/passwd
User group list file:/etc/group
See which users are in the system: cut-d:-F 1/ETC/PASSWD
View users who can log on to the system: CAT/ETC/PASSWD | Grep-v/sbin/nologin | Cut-d:-F 1
View user actions: W command (requires root permission)
View a User: W user name
View Logged-in users: Who
View user logon history: Last