You have forgotten your root password, and now you have no idea how to retrieve your Ubuntu 20.04 LTS Operating System? In this post, we will guide you on how to reset your root password on Ubuntu 20.04 LTS System from the GRUB menu. The Grand Unified Bootloader or GNU GRUB menu is a boot loader and software or program that loads and transfers control to the Operating System like Linux-  it runs when a computer starts. So, let’s begin with the step-by-step guide of resetting the password of the root.

Step 1: Reboot your Ubuntu 20.04 LTS Operating System and load the GRUB menu by holding the Shift Key on Keyboard

The first step is to start your computer machine and keep pressing the shift button on your keyboard until the GRUB menu appears, as shown in the picture below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/reset-root-password-on-ubuntu-20-04-01.png" data-lazy- height="727" src="data:image/svg xml,” width=”974″>

Step 2: Press ‘e’ to edit the commands

Now, select the boot Operating system, which is Ubuntu in our case, and press the ‘e’ key on your keyboard to edit some commands. By doing so, we can load the root shell Command prompt. Pressing the ‘e’ key on your keyboard allows you to have an edit screen, as shown in the picture below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/reset-root-password-on-ubuntu-20-04-02.png" data-lazy- height="727" src="data:image/svg xml,” width=”974″>

Step 3: Edit the clause of the second last line from ‘ro quiet splash $vt_handoff’ to ‘rw init=/bin/bash’

After entering into the editing mode of commands, scroll down until the last, find a line that starts with the word ‘linux’ and change the last clause of this line that reads ‘ro quiet splash $vt_handoff’ to this clause, ‘rw init=/bin/bash’, as shown in the pictures below:

Before

ro quiet splash $vt_handoff

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/reset-root-password-on-ubuntu-20-04-03.png" data-lazy- height="656" src="data:image/svg xml,” width=”974″>

After

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/reset-root-password-on-ubuntu-20-04-04.png" data-lazy- height="643" src="data:image/svg xml,” width=”974″>

Step 4: Press F10 or Ctrl-x to save the edits and boot

Once you have edited the line for loading the root shell command prompt, Press F10 or CTRL X to save and boot the system. After the reboot, a shell command prompt screen of the root will appear, as shown in the picture below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/reset-root-password-on-ubuntu-20-04-05.png" data-lazy- height="541" src="data:image/svg xml,” width=”974″>

Step 5: Type the command ‘mount | grep -w /’ to confirm the read and write access rights

In the root shell command prompt screen, type the command given below for confirmation of the read and write privileges.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/reset-root-password-on-ubuntu-20-04-06.png" data-lazy- height="83" src="data:image/svg xml,” width=”587″>

Step 6: Type the ‘passwd’ command and provide the new password for the root

Once read and write access rights are confirmed, type the ‘passwd’ command and enter or set the new password for the root.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/reset-root-password-on-ubuntu-20-04-07.png" data-lazy- height="143" src="data:image/svg xml,” width=”550″>

You can see that the password is updated successfully.

Step 7: Type the command ‘exec /sbin/init’ to reboot your Ubuntu 20.04 LTS Operating System

After successfully updating the password of the root, the last step is to just reboot your system by typing the command given below:

After running the above command, your computer will reboot and load the welcome screen of the Ubuntu 20.04 LTS system.

Conclusion

The article contains a step-by-step and easy-to-understand guide on how to reset your forgotten root password on the Ubuntu 20.04 LTS system.

About the author

<img alt="Shehroz Azam" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/7011409B3A384F43A8417D1DAC68D179-150×150.jpg" height="112" src="data:image/svg xml,” width=”112″>

Shehroz Azam

A Javascript Developer & Linux enthusiast with 4 years of industrial experience and proven know-how to combine creative and usability viewpoints resulting in world-class web applications. I have experience working with Vue, React & Node.js & currently working on article writing and video creation.