How to delete the user of ubuntu

How to delete the user of ubuntu

Ubuntu – the modern multi-user operating system based on Linux kernel. It differs in simplicity of installation and software update, the high level of safety and also flexible user account control.

It is required to you

  • The computer with the Ubuntu operating system, the rights of root or sudo.


1. In Ubuntu there is very convenient utility for removal of the user from the command line - deluser. It is the interface which is specially ground under operations in the command line to the userdel utility. For start of deluser the rights of the superuser which you can receive are required, having logged in as the root user or using the sudo command. To delete the user of Ubuntu execute a command in the terminal: sudo deluser user_namegde user_name – a name of the deleted user. After execution of a command there will be a removal of the account of the regular user, and he will not be able to log in any more. At the same time its house directory and all files which belong to it will be saved.

2. To delete the user of Ubuntu together with its house directory and a mailbox, add after the deluser command an option - remove-home. If it is required to delete not only a house directory, but also all files of the user in a system, use instead of an option - remove-home a key - remove-all-files. With this key the deluser utility will find all files and directories which owner is the deleted user and will delete them, including a house directory.

3. If you want to delete the user together with its house directory or all files, but want to save them just in case, use an option - backup. With this key, before removal of files of the user, they will be copied in compressed archive tar which will be created during removal of the account in the current directory. To specify other arrangement for archive with files of the user, specify the necessary directory after a key - backup-to.

4. If you want to delete the root user, add to a command a key - force. This key confirms that removal of root of the user is not an error. Without - force cannot be deleted the root user.

5. The user in Ubuntu can be deleted also via the graphic interface. For this purpose open the Administration menu in the section of the starting System menu and select the Users and Groups item. On the screen the window of the program of management of accounts will open. Select the user whom you want to delete in the left list and press the Delete button. In the course of removal of the user you will also be able to select to save files of the user or to delete together with the account.

Author: «MirrorInfo» Dream Team