How to delete a user in linux

王林
王林Original
2021-01-27 15:32:5060527browse

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.

How to delete a user in linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn