How to Reset Forgotten Root Password in Ubuntu

In this article, you will learn how to reset the forgotten root password on Ubuntu 18.04 LTS and Ubuntu 20.04 LTS.

Firstly, you need to either power on or reboot your Ubuntu system. You should get a grub menu as shown below. If you are running your system on VirtualBox, press the ‘SHIFT’ key on the keyboard to bring up the boot menu.

Ubuntu Grub Menu

Ubuntu Grub Menu

Next, press the 'e' key to edit the grub parameters. This should display a screen as shown below.

Grub Boot Parameters

Grub Boot Parameters

Scroll down until you get to the line that begins with 'linux /boot/vmlinuz' the entire line is highlighted below.

Find Grub Boot Parameter

Find Grub Boot Parameter

Narrow down to a section that reads "ro quiet splash $vt_handoff".

Locate Grub Boot Parameter

Locate Grub Boot Parameter

Replace "ro quiet splash $vt_handoff" with rw init=/bin/bash as shown. The aim is to set the root file system with read and write commands denoted by the rw prefix.

Enable Root Filesystem

Enable Root Filesystem

Thereafter, press ctrl + x or F10 to reboot your system. Your system will boot into a root shell screen as shown below. You can confirm that the root filesystem had read and write access rights by running the command.

# mount | grep -w /

The output in the screenshot below confirms read and write access rights denoted by rw.

Confirm Root Filesytem Permissions

Confirm Root Filesytem Permissions

To reset the root password execute the command.

# passwd 

Provide a new password and confirm it. Thereafter, you will get a ‘password updated successfully’ notification.

Reset Root Password in Ubuntu

Reset Root Password in Ubuntu

With the root password successfully changed, reboot into your Ubuntu system by running the command.

# exec /sbin/init

Thank you for coming this far. We hope that you can now comfortably reset the forgotten root password on your Ubuntu system from the grub menu.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

James Kiarie

This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide
The Complete Linux System Administrator Bundle
Become an Ethical Hacker Bonus Bundle

You may also like...

4 Responses

  1. Alexey says:

    Thank you for your article!

    It seems to me, there is a mistake after “To reset the root password execute the command.” The command “passwd” should be inserted in a string instead of “passed”.

  2. Martins Almeida says:

    “To reset the root password execute the command.

    # passed
    

    I think you mean “passwd” and not “passed“. Letters “w” and “e” are next to each other in the keyboard.

  3. dragonmouth says:

    To reset the root password execute the command.

    # passed
    

    Don’t you mean:

    # passwd
    

    Finger check – the “e” and “w” keys are next to each other.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.