linux modify user password command

useradd testuser Create user testuser passwd testuser Set password for the created user testuser Description: The newly created user will create a user directory testuser usermod --help under /home to modify the relevant parameters of 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 don't know where the commands on your system are located, you can use the following commands to find their paths:

locate useradd

img

After a new user is created, the relevant information of the new user will be added to the passwd file in the etc directory at the same time. Description: To take a screenshot, here I used the tail -3 passwd command, and only the last 3 lines of information in the file (also my Concerned information) is displayed

img

Mutual user switching under the command line window: su User name description: su is the abbreviation of switch user, which means that the user can switch back to the previous user state by entering "exit" from the new user state

img

User group addition and deletion: groupadd testgroup group addition groupdel testgroup group deletion description: group addition and deletion information will be reflected in the group file in the etc directory.

img

If you don't want to shut down after shutting down within 10 minutes, you can use ctrl+c to terminate the shutdown command.

The above is the Linux-related knowledge shared by Liangxu Tutorial Network for all friends.

Guess you like

Origin blog.csdn.net/manongxianfeng/article/details/112990319