In systems based on the Linux platform, the root account is first in the user role hierarchy. The root user has the most power over the Linux system. In these systems, users need the root user’s permission to make changes. The root user, by virtue of his exclusive rights, is authorized to change and override the permissions of other users. In the case of an Ubuntu system, the default root user account is initially disabled, but users can still make relevant changes if they know the system’s root password. The real problem occurs when users forget the root user password in their system. In this article, I will show you how to reset the root password on an Ubuntu 20.04 system by modifying the Grub boot loader configuration and booting Ubuntu into a rescue mode.

Changing the root password

To change the root password in your system, open up the terminal window by using the Ctl Alt T shortcut. You can also access the terminal window by going to the ApplicationsTerminal of the system. Now to change the root password, type the following window in the terminal window.

$ sudo passwd root

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

The system will then prompt the users to enter the new password that they want to set up. After that when you press the key, the system will again prompt the user to type the new password once again in the Retype new password field.

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

When you will press the key from the keyboard, the password will then be updated successfully.

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

Resetting the root password

When users have forgotten their root password, then they need to enter the password of the user.

Step 1: Booting to Recovery

To begin with this method, users need to restart their system. As soon as the splash screen appears, press the key from your keyboard. The GNU GRUB screen will appear as displayed below:

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

This is the boot menu for Ubuntu that has different kernel versions that are displayed and has different options. Select the option Ubuntu by pressing the key. When you selected Ubuntu, you need to press the “e” key to open up the grub parameters that are to be edited.

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

Step 2: Changing the configurations

After that use arrow keys again and then scroll down further to the bottom line that begins with “linux /boot/vmlinuz” keyword.

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

From the above-highlighted line, you need to replace “ro quiet splash $vt_handoff” word with “rw init=/bin/bash”.

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

Step 3: Rebooting the system

The next step is to reboot your system. This will be done by using the Ctrl X or by using the F10 key. It will help you to reboot the system along with the updates you made in your system. The system will restart and then you will be landed to your root shell of the system. The shell will appear only one-time and in future, it will appear normally.

To see that if your root file system has been mounted correctly, you need to append the following command in the shell.

$ mount | grep -w /

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

Step 4: Changing the root password

To change the root password, type the following password command:

$ passwd

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

After that, the system will prompt you to type the new password and once you have pressed the enter key, it will again ask you to re-type the password.

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

Once the password is updated, a success message will appear on the screen.

How to Reset Forgotten Root Password in Ubuntu 20.04 linux shell ubuntu

The password is now changed/rest successfully. To confirm the updates, you can restart your system.

Conclusion

In this article, we saw how to reset the root password on an Ubuntu 20.04 system. Forgetting the password is not an issue anymore since you can easily follow this method to update and reset the root password.