This article summarizes some of the commands and parameters that are commonly used when adding or removing users and user groups from Linux.
1, Build Users:
AddUser PHPQ//New PHPQ User
passwd PHPQ//Set password for PHPQ user
2. Build Working Group
Groupadd test//New test Workgroup
3, new users at the same time increase the Working group
USERADD-G test PHPQ//new PHPQ user and added to test workgroup
Note::-G belongs to the group-D home Directory-S used by the shell
4. Increase the Working Group for existing users
USERMOD-G groupname username
Or: Gpasswd-a user Group
5. Temporary shutdown: The second field (password) in the/etc/shadow file that belongs to the user is preceded by a *. To restore the user, remove the *.
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 (Force delete all files and subdirectories in the user's home directory and home directory)
7. Remove users from the group
Edit/etc/group Find the GROUP1 line, delete A
or with a command.
gpasswd-d A GROUP
8. Display user Information
ID User
cat/etc/passwd
For more detailed explanations of users and user groups, please refer to
Detailed explanation of Linux users and user groups
This paper mainly describes the concepts of user and user group management in Linux system, the enumeration of user and user groups (group) commands, and also the multi-tasking of single users and multi-user multitasking.