Please feel free to email me with any questions at with "blog" as the subject.

Search my blog:

Loading...

Sunday, 29 August 2010

Reset forgotten root password

Several linux based operating systems now do not have a root password and instead use sudo as a standard user. This is not for the purpose of unlocking the root account. This method is simply to reset or change a forgotten root password.

I am not liable for any damage you may incur to your system when using this method. I also do not condone the use of this method for malicious or illegal purposes.

When your computer boots up you usually get some sort of boot loader.

With GNU GRUB (very common) you usually get the option to choose an operating system or the option of pressing the Esc key to get to the grub menu.

Once you are at the Grub menu please find the newest kernel. (usually the top entry).

Press the e key to edit the entry.
Now select the second line down (the line starting with the word kernel) that looks similar to:


kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda1 ro quiet splash

Press the e key to edit this entry.
Type the letter S (or word Single) at the end of the (kernel) line. *
Press the ENTER key
Now press the b key to boot the Linux kernel into single user mode.

At the root prompt type

bash$ passwd

to reset password and follow the prompts.

When you type your password it will seem as if you are not typing.
This is normal as * shows how many characters you have so a blank is a security feature.

Once the password has been set you can type

bash$ reboot



to restart the computer.

The root password will now be the one you changed it to.

*(If "s" or "single" do not work you can try typing "init=/bin/bash" instead)

To stop people from using this method to break into your machine you could set a grub password or a BIOS boot password.