(In order to, here I use the tail-3passwd command, only the last 3 lines of information of the file (also I am concerned with the information) displayed)
Create users, set passwords, modify users, and delete users:
Useradd testuser create user testuser
Passwd testuser: Set the password for the created user testuser
Note: the newly created user creates a user directory testuser under/home.
Usermod -- help modify the parameters of the user command
Userdel testuser delete user testuser
Rm-rf testuser: delete the directory of user testuser
The above commands can only be used by the root account. if you do not know where the commands on your system are located, you can use the following command to find the path:
Locate useradd
After creating a new user, the new user information will be added to the passwd file under the etc directory.
Note: For this purpose, I used the tail-3 passwd command to only display the last three lines of information (which is also my concern) of the file.
Switch between users in the command line window:
Su user name
Note: su is the abbreviation of switch user, indicating user switching
Enter "exit" in the new user status to return to the user status.
Add and delete user groups:
Add a groupadd testgroup Group
Delete groupdel testgroup
Note: The added or deleted group information is displayed in the group file of the etc directory.