How to delete a user on Ubuntu
|DIFFICULTY strong>||Basic - 1 | Medium - 2 | Advanced - 3 td>|
|TIME REQUIRED strong>||5 min|
|RELATED PRODUCTS strong>||Linux-based VPS or dedicated servers|
Here is a quick tutorial on how to delete a user on Ubuntu.
Remove the user's account
Open a terminal window and enter the following command:
The above line uses the userdel command to remove the account for testuser. The use of sudo ensures that this command has the required superuser privileges.
Delete the user's home directory
Enter the following command to delete the user's home directory:
This command removes the directory with the rm command. The r option removes the directory recursively, meaning that the subdirectories of /home/testuser are also removed. The f option forces the command, meaning that it will assume default responses without prompting you.
Verify the user account has been deleted
You should receive an error saying this user does not exist