Create a user, set a password, modify a user, delete a user:
useradd testuser Create user TestUser
passwd testuser set a password for the created user TestUser
Description: The newly created user will create a user directory under/home TestUser
usermod--help Modify user parameters for this command
userdel testuser Delete user testuser
rm-rf testuser Delete the directory where the user testuser is located
The above commands can only be used by the root account, if you do not know where the command above your system can use the following command to find its path:
Locate Useradd
When a new user is created, the information about the new user is added to the passwd file in the ETC directory.
Description: In order to, I used the tail-3 passwd command Here, only the last 3 lines of the file (and the information I'm concerned about) are displayed.
User Switching between command-line windows: su user name
Note:SU is the abbreviation for switch user, which means that the users switch to the user state by entering "exit" from the new user state
Add and remove user groups: groupadd testgroup Group Add groupdel testgroup Group deletion
Note: the addition and deletion information of the group is reflected in the groups file of the etc directory .
Linux Create user command