Take the 2-minute tour ×

When trying to remove the user, it returns "user is currently logged in".
I already killed the user using pkill -KILL -u usernameHere and several other commands, but it does not help.

How can I remove this user?

Running CentOS 6.

share|improve this question
add comment

2 Answers

up vote 23 down vote accepted

SU to the user su - username and run kill -9 -1 as the user.

Exit the shell and try the userdel -r username again.

Or you can check for processes from the user using lsof -u username and kill the relevant PIDs.

Or pkill -u username or pkill -u uid

share|improve this answer
add comment

Or ps -aux | grep <username> and kill the processes the user is running.

share|improve this answer
add comment

Your Answer


