How to delete a user account on Ubuntu Linux

Here are the steps to delete a user account on Ubuntu Linux:

  1. Log in as root or use the sudo command to run the following commands with administrative privileges:

     
    sudo su
  2. Use the userdel command to delete the user account. Replace username with the actual username you want to delete:

     
    userdel username
  3. 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
  4. To remove the user’s group, use the groupdel command:

     
    groupdel username

Note: Be careful when deleting user accounts and always make sure to backup important data before making changes.

(thehubmiddletown.com)

Leave a Comment