How to Delete a User on Ubuntu System
Ubuntu is a Linux operating system based on the Debian distribution. As with all other operating systems, maintaining user accounts is a routine task for Ubuntu system administrators. The essential steps for removing a user in Ubuntu include deleting the account and all of the files of user.
This tutorial will help you how to delete user on an Ubuntu system.
Step #1: Delete New User on Ubuntu System
You find that you no more need to have a particular user on the ubuntu system you can delete them with a single command.
# userdel user_name
If you want to remove all of the files for the user, then use -r switch:
userdel -r user_name
Step #2: Remove Root Privileges to the User
If you have configured sudo privileges for the user you deleted, you may want to remove the relevant line using following steps:
# sudo nano /etc/sudoers Or # sudo visudo
Find the following lines:
# User privilege specification root ALL=(ALL:ALL) ALL user_name ALL=(ALL:ALL) ALL
Remove the username entry to remove root privileges for the corresponding user:
user_name ALL=(ALL:ALL) ALL