How to delete a user account on Ubuntu Linux

www.la‮ruttu‬i.com
How to delete a user account on Ubuntu Linux

To delete a user account on Ubuntu Linux, follow these steps:

  1. Open a terminal window.

  2. Use the sudo command to execute the following command as the root user:

sudo userdel username

Replace username with the name of the user account you want to delete.

  1. If the user's home directory is located in the default location (/home/username), you can use the -r option to delete the user's home directory and all of its contents:
sudo userdel -r username
  1. If the user is a member of any groups, you can use the -G option to remove the user from those groups:
sudo deluser username group1 group2

Replace group1 and group2 with the names of the groups you want to remove the user from.

Keep in mind that deleting a user account will also delete any files or directories owned by that user, including any data in their home directory. Be sure to back up any important data before deleting a user account.

Created Time:2017-10-28 21:39:01  Author:lautturi