General

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 CTRL + ALT + T on your keyboard. 

Once you have the terminal open, you can do a basic user delete with:

sudo userdel <user>

If the user has a /home/user directory, you can delete that at the same time with this:

sudo userdel -r <user>

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:

sudo killall -u <user>

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:

sudo userdel -f <user>

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.

Closure:

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.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Setting Up Coding Environments on Linux for Educational Use

With so many strong attributes, such as robustness and flexibility, Linux stands as a powerful…

19 hours ago

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

3 days ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

5 days ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

7 days ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

1 week ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

2 weeks ago