Thursday 10 November 2011

Password reset via Recovery mode + Passwd protecting GRUB entries.


This is the most common technique used, what I try when i get an Ubuntu System with un-protected Recovery Mode GRUB entries. Read this from howtogeek.com


First a quick look into how to reset password via the Recovery mode.
When a ubuntu machine boots up it presents us with a GRUB loading screen. Hit "Esc" to get to the menu as shown below :


Now the highlighted entry is the Recovery Mode. From here you can either select "drop to shell prompt" and if it still asks for a password, then you can try this.
Select the Recovery mode entry and press "e" to edit the entry.

Then in next screen select the Kernel entry. You are presented as an entry like this.


 
 Now replace "ro quiet splash" with

rw init=/bin/bash

Once you have done this hit "Enter" and use "b" to boot

You are presented with a root shell

Issue "passwd" command to change password for root.
Issue "passwd <username>" to change password for a user.


Issue "sync" command to write the changes to disk.