How To Become Root In Ubuntu?

The root user in Ubuntu can access all files and commands of the Linux operating system. The other names for the root user are root account and superuser. Since the root user can change the system configuration, Ubuntu has locked the root user service by default to avoid any unintentional errors. The basic system operations do not need root user access. If you want to change the account settings or user permissions, read more to learn how to become root in Ubuntu.

  1. Press the Ctrl, Alt, and T keys together to open the terminal window.
  2. Use the ‘sudo’ command.

    1. Input the following commands and press Enter to become the root user. sudo –i
    2. If the command prompt changes from ‘$’ to ‘#,’ you have switched to the root user account.
    3. Enter the following command to verify the type of account. whoami
    4. For the ‘sudo’ command, you do not need the root user password; instead, enter the user password.
    5. Set the root user password after changing to the root account using the below commands. sudo passwd root
    6. Remove the password with the following commands. sudo passwd –dl root
    7. It is better to not use the password because it is difficult to reset the password.
    8. When you run a command using the ‘sudo’ command, the system prompts for the user password instead of the root user account. See the below example.
    9. sudo apt update
    10. [sudo] password for username:
  1. Using ‘su’ command.
    1. Another way how to become root in Ubuntu user is to run the below commands. sudo su
    2. If you are using the ‘sudo su’ command to access the root account, you need to know the root user password.
  2. Use the following command to come out of the root user account or become the normal user. exit

How To Become Root In Ubuntu