Tuesday, May 25, 2010

how to reset root password in ubuntu

Step 1)  If you have a graphical GRUB menu  you will want to hit the "esc" key at the boot menu.  This will prompt you with a message box saying you are leaving the graphical boot menu and starting text mode interface.  Hit OK.  Otherwise you may already be in the text mode interface.
Step 2) Once in text mode, highlight the default boot option (you want to reset the Root password for) and hit "e" to Edit the commands before booting.

Step 3) Highlight the line that starts with "kernel", press "e" again to edit this entry.

If you are using (K)Ubuntu 9.04 (Jaunty Jackalope and in some cases, earlier versions of Ubuntu) and you follow the above steps, you may find a known bug when presented with a text menu in which you may not be able to select anything, but instead can see all your key strokes as escape characters.  In such a case you may try this work around:

Instead of typing the word "single" as stated in step 4 above, type the following:

1:
      
init=/bin/bash
      

Using Kubuntu 9.04, mine would look like this:
1:
      
kernel /boot/vmlinuz-2.6.28-11-generic ... part2 ro quite splash vga=0x314 init=/bin/bash
      

Hit "enter" to save, "esc" to go back to the boot screen, and "b" to boot.  You will be presented with a prompt that looks like the following:
1:
      
root@(none):/#
      

Once at the prompt, type the following:
1:
2:
3:
      
mount -t /proc
mount -o remount,rw /
passwd
      

type the new password   (hit enter)
retype for confirmation  (hit enter)
You should now see a "password successfully changed" message.
Reboot your machine and login.

No comments:

Post a Comment