Showing posts with label not able to remove user. Show all posts
Showing posts with label not able to remove user. Show all posts

Tuesday, July 23, 2013

userdel: user is currently logged in

userdel: user `username` is currently logged in

If you are trying to remove / delete a user 
# userdel username
and it shows following warning

userdel: user `username` is currently logged in

Now you are not able to remove the user.

Solution :

Run following command.
# pgrep -u username
In place of word username, put your username which is giving you trouble.
Now kill the instances using
# killall -u username
Now try to delete your user but you are still getting same message, check again
# pgrep -u username
You can't run delete user command successfully until you get the instances of the same user using pgrep command.
The result of pgrep command should be blank, No result.