How To: Properly Delete a User’s Account
Today’s article will show you how to properly delete a user’s account. It’s a pretty basic task and an astute observer would note that I’ve not yet written an article about creating user accounts. I may have to write said article at some point, because why not? This promises to be a pretty easy and brief article!
When you install some software, it may add a user. When you remove that software, it may just leave that user behind. You may have multiple people using your devices, or you may be working in a corporate environment. Either way, there comes a time when you may want to clean house and delete user accounts that are no longer necessary.
It can be just a little tricky to properly delete a user’s account, so I figure it’s something worth covering. The tool we’ll be using is ‘userdel‘ and my checking indicates it’s universal. Let’s get to it!
Delete A User:
I’m gonna assume that you already know the name of the user you’d like to remove from your system. With that information in hand, let’s open the terminal by pressing
Once you have the terminal open, you can do a basic user delete with:
If the user has a /home/user directory, you can delete that at the same time with this:
Seems nice and easy, right? Well, before you should run any of those commands you should be sure that the user is both not logged in and has no processes running in their name. If you do have either of those things, you will want to run this command before running either of the userdel commands above:
You can also try the -f (force) option with the userdel, but I’ve never had good luck with that. So, your better using killall before you use userdel. If you’d like to try it, here it is:
And that’s actually everything. There’s likely to also be a graphical way to delete users and that’ll depend on your desktop environment. Rather than play around with learning and documenting all those, you can just do it in the terminal where it’s easy enough and equally effective.
And now you know how to delete a user account, and how to do it properly. Indeed, this is another article in the books and hopefully this one will help people for years to come. It’s a good idea to not have pointless users around on your system. If they exist, they can be used.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.