CentOS user and user group management, centos User Group
Groupadd maid creates a group according to the system's default gid. The same as the root uid, gid also starts from 1000.
Groupadd-g 1008 create a user group with gid = 1008: maid
Groupdel maid Delete Group
Groupdel cannot delete the user master group of user1
Useradd [-u UID] [-g UID] [-d HOME] [-M] [-s]
-U indicates the custom UID
-G indicates the name of the new user group, which can be followed by the group id or group name.
-D. Customize the user's home directory
-M indicates that the home directory is not created.
-S indicates the custom shell
Useradd test10 adds user test10.
If useradd directly follows the user name without any options, a group with the same name is created.
Userdel user12 delete user user12 and keep the home directory
Userdel-r user12: delete user12 together with the home directory.
Passed gys: Set the user's gys password.
Su switches to the root user, and the current directory remains unchanged.
Su-switch to the root user and change the directory to/root