How to Reset Root Password on Ubuntu

First, you need to power on or reboot your Ubuntu system. You should get a grub menu as shown below. If you your os on virtualbox thenb press the ‘SHIFT’ key on the keyboard to bring up the boot menu.

Ubuntu Grub Menu

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

Grub Boot Parameters

Scroll down & find the line begins with 'linux /boot/vmlinuz' see below.

Find Grub Boot Parameter

Find the text "ro quiet splash $vt_handoff".

Locate Grub Boot Parameter

Replace "ro quiet splash $vt_handoff" with rw init=/bin/bash or add it. The rw prefix set to the root file system with read and write permission.

Enable Root Filesystem

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

# mount | grep -w /

You will see something like below.

Confirm Root Filesytem Permissions

To reset the root password execute the command.

# passwd 

Now set a new password and confirm it. You will get a ‘password updated successfully’ notification.

Reset Root Password in Ubuntu

After the root password successfully changed, reboot your Ubuntu OS by this command.

# exec /sbin/init

Thank you for reading this article.

Was this helpful?

2 / 1

Leave a Reply 0

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