I added a user just for learning purpose how to add user using the command sudo useradd usernamefollowed by my password, the user is created successfully.

Now I don't want it and running the command sudo userdel username in terminal, instead of removing the user it is showing

userdel: user sonu is currently used by process 13404. 

Also I tried to remove it from user & accounts option in all setting there it is showing running

'/usr/sbin/userdel' failed: Child process exited with code 16. 

now I've no idea how do I remove this unwanted user.

  • 'user sonu is currently used by process 13404' Says all you need to know. – davidbaumann Dec 6 '14 at 14:20
  • so you mean till process 13404 will be using user sonu i will not be able to remove it. – user299731 Dec 6 '14 at 14:22
  • 1
    I guess, after rebooting you will be able to remove the user. Or you find the process with htop. – davidbaumann Dec 6 '14 at 14:24
  • rebooting worked – user299731 Dec 6 '14 at 16:25


su - 
Password: <Enter password of root user> 
root@host: sudo deluser sonu

sidenote : If you write su- for very first time on the terminal then first you have to activate root user by assigning password.

$ sudo passwd root
[sudo] password for <currentuser>:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

tips: keyword search of man pages can be then performed using man -k keyword

 man -k user  
 man -k password

will gives the list of useful commands with brief info

  • 2
    su - will not work in Ubuntu by default. Use sudo -i – Panther Dec 6 '14 at 18:49
  • @bodhi.zazen you website has no contact email. – diEcho Dec 6 '14 at 19:57
  • @diEcho Leave a comment on most any blog page and I will send it to you. – Panther Dec 7 '14 at 4:03

You can do it with these commands in terminal:

sudo userdel user_name
sudo rm -rf /home/user_name

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

  • How does this help in removing a user? – Seth Dec 8 '14 at 19:55

if none of the above method worked, install webmin and delete the user from GUI interface, it works 100%

  1. sudo apt-get install webmin.
  2. open internet browser and goto https://localhost:10000/
  3. system > user and groups.

Firstly you should list all the processes related to the particular user by using:

pgrep -u username


ps -f --pid $(pgrep -u username)

Then you can kill all processes running for that user by:

killall -9 -u username

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.