Saturday, January 16, 2010

How to Hack Root Password in Linux

Today I am going to tell you the trick to hack your root passoword in Linux if you are too forgetful to remember it or you have legal permission to enter a server run by a different admin and by any chance he forgot to give you the root password.

Those Who Have GRUB bootloader

  1. The first step is to reboot server.
  2. Upon Linux booting up to GRUB loader GUI, move the arrow key up/down to highlight and select the Linux kernel and press e to edit the GRUB commands before booting.
  3. Next, move the arrow key up/down and select the Linux kernel and press e again
  4. Give a single space and then type the word single at the end of edited line, as shown in this snapshot
  5. Press the ENTER key and now you have a a similar GRUB screenshot as of follow.Keep the Linux kernel highlighted and press b to boot up with the single keyword, which will boot Linux into single user maintenance mode (You did nothing but to grant yourself the booting facility of a single user that is otherwise not visible while you enter the server as a root in a proper way)
  6. Once the Linux boot up completely into single user maintenance mode, the Linux command prompt is ready to execute command. Type passwd to reset the forgotten root password - without prompting for old root password, just type a new root password and re-type to confirm it and you are done. You have successfully changed or reset the old password without having known the old one.
  7. Type reboot or exit to reboot. On next boot up, you can login with the new root password!

Remember, it is for those who have GRUB bootloaders.

Those who have LILO boot loader

  1. First reboot the server
  2. When you see the LILO: prompt type linux single and hit enter.
  3. This will log you in as root in single user mode.
  4. Once booting is complete, you can change your password with this passwd followed by the new password you want to assign
  5. You are done.

1 comment: