To delete a user account on Ubuntu Linux, follow these steps:
Open a terminal window.
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.
/home/username
), you can use the -r
option to delete the user's home directory and all of its contents:sudo userdel -r username
-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.