Ubuntu Root Password: Set password for the Ubuntu root user

During the Installation most Linux distributions will ask to create a password for the root user. However, Ubuntu will not ask for the root password during the installation. Instead, Ubuntu creates a regular user with sudo privileges.

By default Ubuntu locks the root account by not assigning a password to the root user. But we can unlock the root account by creating a password for the root user.

Do the following steps to create Ubuntu Root Password.

First, login to the user account you created during the Ubuntu Installation (Or any other user with sudo privileges).

Run the sudo -i command:

sudo -i

When prompted, Enter your password.

Then, run the passwd command to set the password for the root user.

passwd


This will unlock the root account.