- Root In Ubuntu
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.
- Press the Ctrl, Alt, and T keys together to open the terminal window.
- Use the ‘sudo’ command.
- Input the following commands and press Enter to become the root user. sudo –i
- If the command prompt changes from ‘$’ to ‘#,’ you have switched to the root user account.
- Enter the following command to verify the type of account. whoami
- For the ‘sudo’ command, you do not need the root user password; instead, enter the user password.
- Set the root user password after changing to the root account using the below commands. sudo passwd root
- Remove the password with the following commands. sudo passwd –dl root
- It is better to not use the password because it is difficult to reset the password.
- 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.
- sudo apt update
- [sudo] password for username:
- Using ‘su’ command.
- Another way how to become root in Ubuntu user is to run the below commands. sudo su
- If you are using the ‘sudo su’ command to access the root account, you need to know the root user password.
- Use the following command to come out of the root user account or become the normal user. exit