Forgot Root Password

Problem : Forgot Linux root password.

I think this must be a common problem to a lot of users, forgetting the root password of their system or in the case of New ubuntu like systems that do not have a root log in, if you forget the password for the only user in your system then you are stuck with no way of logging in. Well there is simple work around for situations like this.
Follow the following steps to reset your root password. [Please see below for ubuntu systems]

1. While your system boots go the GRUB menu by pressing "esc".
2. Highlight the OS you want to boot using the arrow keys.
3. Press "e"
4. You will see three options ( generally), move to the line that starts with "kernel".
5. press "e" again
6. You will see a line of text, move to the end of it.
7. Add "single" or "1" to the end of the line.
8. Hit Enter and press "b".

Your system should boot into a text mode, with a shell prompt.

typer  "passwd" and hit enter.
You will be prompted for a new password. enter the password , you will be asked for confirmation enter the password again.

enter the command "reboot" and hit enter.

The system should boot back to your normal log in screen, you can use the new password that you just set for the root log in.

In case of Ubuntu systems this method does not work very well so there is slightly different way of making it work.
in step 7: instead of adding "1"  add the text "/dev/sda=rw"  assuming sda is the partition on which you have your Linux installed.

Hope you are able to log into your system again :-)

No comments:

Post a Comment

Follow by Email