25.3.11

Reset the root password from Grub2


I had some keyboard layout related problem I was not able to join with my user / password
Using the Recovery mode asked for a user / password too
The solution was to reset the password from Grub2




First, you have to reboot into recovery mode.

If you have a single-boot (Ubuntu is the only operating system on your computer), to get the boot menu to show, you have to hold down the Shift key during bootup.

If you have a dual-boot (Ubuntu is installed next to Windows, another Linux operating system, or Mac OS X; and you choose at boot time which operating system to boot into), the boot menu should appear without the need to hold down the Shift key.

For older versions of Ubuntu (9.04 and 8.04), you can press the Escape key during bootup in order to see the boot menu.


How to reset your password in Ubuntu
From the boot menu, select recovery mode, which is usually the second boot option.



After you select recovery mode and wait for all the boot-up processes to finish, you’ll be presented with a few options. In this case, you want the Drop to root shell prompt option so press the Down arrow to get to that option, and then press Enter to select it.

The root account is the ultimate administrator and can do anything to the Ubuntu installation (including erase it), so please be careful with what commands you enter in the root terminal.

Once you’re at the root shell prompt, if you have forgotten your username as well, type

ls /home

That’s a lowercase L, by the way, not a capital i, in ls. You should then see a list of the users on your Ubuntu installation. In this case, I’m going to reset najashark’s password.

To reset the password, type

passwd username

where username is the username you want to reset. In this case, I want to reset najashark’s password, so I type

passwd najashark

You’ll then be prompted for a new password. When you type the password you will get no visual response acknowledging your typing. Your password is still being accepted. Just type the password and hit Enter when you’re done. You’ll be prompted to retype the password. Do so and hit Enter again.

Now the password should be reset. Type

exit

to return to the recovery menu.


After you get back to the recovery menu, select resume normal boot, and use Ubuntu as you normally would—only this time, you actually know the password!

Note:
Some people get freaked out about having recovery mode logging you in as root.

Emergency Reset:
If you are in a weird situation in which your Grub boot menu timeout is 0 seconds, so you cannot select recovery mode or edit any kernel lines, you can use a live CD to reset your user password

enjoy!
5 najashark.net: Reset the root password from Grub2 I had some keyboard layout related problem I was not able to join with my user / password Using the Recovery mode asked for a user / passw...

2 comments:

Post Comment

< >