Scenario / Questions
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.
Find below all possible solutions or suggestions for the above questions..
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.
pkill -u username or
pkill -u uid
ps aux | grep <username> and
kill the processes the user is running.
If the above steps doesn’t help.! (Assuming you are using on the runlevel 5 )
- Change the runlevel to 3 (
- log-in with other than deleting account to delete ( root/other account)
userdel -r username
I try the steps to del the user1
kill -9 -1
sudo deluser user1
Disclaimer: This has been sourced from a third party syndicated feed through internet. We are not responsibility or liability for its dependability, trustworthiness, reliability and data of the text. We reserves the sole right to alter, delete or remove (without notice) the content in its absolute discretion for any reason whatsoever.