How to delete a user account on Ubuntu Linux
Here are the steps to delete a user account on Ubuntu Linux:
-
Log in as root or use the
sudocommand to run the following commands with administrative privileges:sudo su -
Use the
userdelcommand to delete the user account. Replaceusernamewith the actual username you want to delete:userdel username -
By default, the user’s home directory and its contents are not deleted. To delete the home directory, use the following command:
rm -rf /home/username -
To remove the user’s group, use the
groupdelcommand:groupdel username
Note: Be careful when deleting user accounts and always make sure to backup important data before making changes.
(thehubmiddletown.com)