Delete users

In Ubuntu, you can delete users using shell commands or the GUI tool.

Delete users using the GUI tool

To delete users using the GUI tool, click on the System Setting button on the left side of your screen. In the window that opens, type user. This should find the GUI tool called User accounts:

delete users ubuntu 1

In the window that opens, click on the Unlock button in the upper right corner. You will need to provide the root password.

delete users ubuntu 2

Now, click the minus button in the lower left corner. This opens up a new window:

delete users ubuntu 3

Choose whether you want to keep the user’s files. If you don’t want to keep them, click the Delete files button. And that’s it! The user is removed from the system.

Delete users using the deluser command

You can use the shell command deluser to delete a user. Here is an example:

linux deluser command

Some resources mention userdel as a utility to delete users. In Debian, deluser is the front end to the userdel and the recommended way to delete user. Even the man page for userdel says that you should use deluser instead: “On Debian, administrators should usually use deluser instead”.
Geek University 2022