Home » Home » How To Reset root Password From Recovery mode in Ubuntu?

What if you are inheriting a machine with Ubuntu desktop in your workplaces and you have no idea what could be the password. This may be a weird situation, if I were you I go for setting up a new installation. HOO!! But what happens to the existing data!! So you need to reset the password without reinstalling, this situation can be unknotted by simply performing the following process.

How To Reset root Password From GRUB ?

Okay, It’s good to know little about GRUB before starting. GNU GRUB (GRand Unified Bootloader) is a program that installs a boot loader to the MBR (Master Boot Record), which exists at the beginning sectors of a disk. It allows you to place specific instructions in the MBR that loads a GRUB menu or command environment, permitting you to start the operating system of your choice, pass special instructions to kernels when they boot, or discover system parameters (such as available RAM) before booting.

STEP 1 :- To start the process, Restart your machine.

STEP 2 :- At the time of booting hold the SHIFT key for a little while, to get the GRUB menu like this.

Grub Menu

STEP 3 :-  Use the ↑ (up) and ↓ (down) keys to select recovery mode. Then hit e key to edit the boot options, the screen would be like this

Grub_boot_options

STEP 4 :- Here you could locate a line looks like this

linux /boot/vmlinuz-3.2.0-18-generic root=UUID=b8b64ed1-ae94-43c6-92d2-a19dfd9a727e ro recovery nomodeset:

The line differs according to the versions of Ubuntu and the kernel it has, but it should have the same syntax.

STEP 5 :- Edit the last part of the line ro recovery nomodeset:”  to “rw init=/bin/bash:”, so the line should be like this 

linux /boot/vmlinuz-3.2.0-18-generic root=UUID=b8b64ed1-ae94-43c6-92d2-a19dfd9a727e rw init=/bin/bash:

The line explains that to start the init by calling /bin/bash instead of the recovery nomodeset.

STEP 6 :- Now you can boot the OS by keying F10 key with the current settings.

STEP 7 :- This will launch bash with root access. That’s it, now you can change the root password by “passwd” command.

STEP 8 :- Enter passwd commandThen it should ask you to enter the new password twice. Once that’s done reboot the system to reset the GRUB menu changes, this will not affect your new password.

Hope you enjoyed the article feel free to leave your comments and please do share.

One thought on “How To Reset root Password From Recovery mode in Ubuntu?

  1. malatesh says:

    nice information and no confusion also. good.

Leave a Reply

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

CAPTCHA Image

*