# How to delete users on Ubuntu 20.04

On Ubuntu 20.04 you can delete a user using the `deluser` command in the terminal or in the graphic user interface. Only root users and those with `sudo` privileges can delete a user and their files.

## Who can delete a user on Ubuntu?

Only users with root or [sudo privileges](https://www.ionos.com/digitalguide/server/configuration/linux-sudo-command/) can delete users in [Ubuntu](https://www.ionos.com/digitalguide/server/know-how/ubuntu-the-linux-system-for-everyone/). The same goes for [adding new users on Ubuntu 20.04](https://www.ionos.com/digitalguide/server/know-how/create-users-in-ubuntu/).

## How to delete users on Ubuntu 20.04 in the terminal

One way to remove a user on Ubuntu is with the `deluser` command in the terminal.

### Deleting users as root

If you are logged in as the root user you can remove any user with the `deluser` command. Simply enter the following code in the terminal and replace the placeholder “username” with the user you want to delete:

```bash
# deluser username
```

Now you’ve deleted the user, but their **account data** is still there. To delete this data as well, use the following command. It will delete the home directory and all the files in it.

```bash
# deluser --remove-home username
```

### Deleting users with `sudo` privileges

If you’re **not the root user** and want to delete a user on Ubuntu 20.04, enter the following code. Replace “username” with the name of the user you want to delete.

```bash
$ sudo deluser username
```

To delete the user’s files, use this command:

```bash
$ sudo deluser --remove-home username
```

## How to delete users on Ubuntu 20.04 using the graphic interface

Alternatively, users with `sudo` privileges can also delete a user using the **graphic user interface**. Follow these steps:

1. Open the settings.
2. Click on **User**.
3. Click on **Unlock…**. You’ll now be asked for your password. Enter it and then confirm.
4. Select the user that you want to delete.
5. In the bottom right, you’ll see a red button with white letters that says **Remove User…**. Click on it.
6. You’ll be asked to confirm, and then whether you want to delete the user’s home directory. Make your selection, and the user will be deleted.

[![Image: Deleting a user in the Ubuntu graphic user interface](https://www.ionos.com/digitalguide/fileadmin/_processed_/2/7/csm_ubuntu-user-entfernen_465ada1714.webp "Deleting a user in the Ubuntu graphic user interface")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/ubuntu-user-entfernen.png) Select the user that you want to delete.


This is a markdown version of: [https://www.ionos.com/digitalguide/server/know-how/ubuntu-delete-user/](https://www.ionos.com/digitalguide/server/know-how/ubuntu-delete-user/) for AI/LLM consumption.