How to delete a user in Linux: 1. Execute the [ps -u username] command to view the user's pid; 2. Execute the [kill pid] command to end the user's sshd or shell process; 3. Execute [userdel - r username] command to delete the user.
The operating environment of this article: red hat enterprise linux 6.1 system, thinkpad t480 computer.
(Learning video sharing: linux video tutorial)
Specific method:
1. First use the command cat /etc/passwd to view Check all the users and you can see the user name you need to delete
2. Use the command who to query the currently logged in user
3. Use the command ps -u username to view the pid of the user
4. Use the command kill pid to kill his sshd or shell process
5. Then use the command userdel -r username to delete the user
Related recommendations: linux tutorial
The above is the detailed content of How to delete a user in linux. For more information, please follow other related articles on the PHP Chinese website!