
List of content you will read in this article:
Switching to Root Temporarily
By assigning sudo rights to everyday users, Ubuntu users are encouraged to conduct server administrative tasks. Registered users can run programs as another user, normally the root user, using the Sudo command.
The sudo community is now a part of the initial user generated by the Ubuntu installer. It's likely that the person you're now logging in as has administrative rights. To briefly escalate root user rights, run the following command with the sudo prefix:
Sudo name
The very first moment you use sudo in a process, you'll be prompted for the user password.
To briefly switch to the root account in the current login session, use sudo su or sudo -i command and insert the user password:
sudo su
or
sudo -i
To ensure that the user has been updated as root, use the whoami command:
whoami
Output
root
Modifying Root Password
Since the root user has been disabled, this does not imply that the root account has been deleted. Since the root account has no password, logging in as root is not feasible.
All users have to do is open the root account to create a password for the system administrator. The passwd command in Ubuntu allows you to set or change a user account's password. When generating the password, make sure to use a strong and exclusive password.
The most critical part of your account's protection is using a secure password. A good password usually consists of at least sixteen characters, an uppercase letter, a lowercase letter, an integer, and a special character. To change the root user's password in Ubuntu, type the command given below as a Sudo user:
sudo passwd root
You will be asked by the following command to enter and confirm the new root password. You will be prompted to retype it again. When you enter the password, it does not appear on the page. When you have successfully entered the new password, you will see the following output:
passwd: password updated successfully
The password for the root account has been updated. Users can now sign in to the Ubuntu system as root using the latest password.
Conclusion
The root account in Ubuntu has no password by default. The Sudo command is recommended for executing commands with root privileges. Before you could even log in as root, you will be needed to set the root password. We hope that the given information will help you to understand why the root user is not enabled by default.
Seamlessly integrate with various Linux-based applications and enjoy the flexibility to scale resources as required. Take advantage of the opportunity to buy a Linux VPS from 1gbits and unlock a world of possibilities for your online presence.
People also read: