Today we learn How to Change Root Password in Ubuntu Linux 20.04 and other Ubuntu All Linux Version, The root user (or superuser) is a special account that exists on all Linux and Unix-like systems. It has full access to every command and any resource on the system without any restrictions.
If you’re new to Ubuntu from another Linux distribution, you might be wondering what the standard password for the root user is or how to change the root password. By default, on Ubuntu, the root account is disabled for security reasons.
This tutorial explains how to temporarily change to a root user account and how to set a root password on an Ubuntu system.
Temporarily switch to root
Ubuntu users are encouraged to perform system administration tasks by granting sudo privileges to regular users. Sudo allows authorized users to run programs as another user, usually the root user.
The early users the Ubuntu installer created were already members of the sudo group. Most likely the user you are logged in with is currently granted administrative privileges.
To temporarily increase the privilege to root, run the command prefixed with sudo:
The first time you use sudo in a session, it will ask you to enter the user password.
To temporarily switch to the root account in the current login session, you can use the command
sudo -iand enter the user’s password:
sudo su -
Run the command
whoami to verify that the user is modified:
Changing the Root Password in Ubuntu
Ubuntu’s root user is disabled, but that doesn’t mean that the root account has been deleted. Logging in as root is not possible because no password has been set for the root account.
If for some reason, you need to activate the root account all you need to do is set a password for the root user. In Ubuntu, you can set or change a user account password with commands
To change the root password in Ubuntu, run the following command as user sudo:
sudo passwd root
You will be asked to enter and confirm the new root password.
When setting a password, make sure you use a unique and strong password. Having a strong password is the most important aspect of your account security. Often a strong password has at least 8 characters, which contains at least one uppercase letter, one lowercase letter, one number, and one symbol character.
Passwords are not displayed on the screen when you type them.
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
There he is! The root password has been changed.
Now you can log into your Ubuntu system as root using the new password.
On Ubuntu, the root account has no password By default. The recommended approach is to use the sudo command to run commands at the root level.