How to Hack Root Password in Linux
By Angsuman Chakraborty, Gaea News NetworkMonday, November 3, 2008
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
- The first step is to reboot server.
- 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. - Next, move the arrow key up/down and select the Linux kernel and press
e
again - Give a single space and then type the word
single
at the end of edited line, as shown in this snapshot - 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) - 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. - Type
reboot
orexit
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
- First reboot the server
- When you see the LILO: prompt type linux single and hit enter.
- This will log you in as root in single user mode.
- Once booting is complete, you can change your password with this passwd followed by the new password you want to assign
- You are done.
P.S. - Admins, take a note and use passwords to secure LILO and GRUB so that no one gets access to boot loaders’ commands. I will surely come with a tutorial on that too.
Tags: Grub, Hack root password, LILO, Maintenance, The root
July 20, 2010: 11:36 pm
I would also like to know how can be create a single page with payment system in an estore.. where the shipping information and payment info can be made on single page |
dE |
July 11, 2010: 11:47 am
Thanks for telling me this security venerability. Now I’ll ensure the grub menu never comes up. |
sanjay |
Tumar baba |
January 22, 2010: 5:18 am
U are giving some false info in this site. So plz stop fooling others and save their time from surfing ur website. dont take it personally. |
rickastley |
December 3, 2009: 5:11 am
Hai this is naveen from intellectindia. I was installed Fedora 8 to my System and i give the password as kavitha.but when i try to logon root cannot taken the password.please help me. |
Dave |
Darin Peterson |
July 7, 2009: 1:01 am
You saved my butt on that one. I’m not one to forget passwords, or to mess up when typing them, but just so happened that I updated my Linux PCs passwords and must have double fat fingered the root and user passwords… I can’t thank you enough! Darin |
April 28, 2009: 5:20 pm
my root was not login & i am trying to give passwd to my root but it didn’t work help me |
arian |
March 16, 2009: 8:19 am
hi!!!!!!! |
Avishek |
February 26, 2009: 12:57 pm
What should I do if the computer does not show the “e” option. The only difference is that this computer has two kernels… and none of them gives the edit option–all I am allowed to do is selection using up and down arrow key or type “p” for further tasks. |
November 7, 2008: 7:46 am
@ anjan I am currently using Fedora. I feel the same should apply for Ubuntu as well.Here is a slightly different process Press e for edit. Highlight the line that begins kernel ………, press e Go to the very end of the line, add rw init=/bin/bash press enter, then press b to boot your system. Your system will boot up to a passwordless root shell. Type in passwd username Set your password. Type in reboot [p.s. -> adding init=/bin/bash to your kernel line takes you straight to a bash prompt from bootup. You'll probably have to remount your '/' partition as rw, and remember to sync after making any changes. You won't be able to shut down nicely from this state, so ctrl + alt + del is the only option.] Tell me if that worked. |
November 5, 2008: 4:40 pm
hi soumya, can you post pics for ubuntu, say 8.10 as well ? thank you, BR, |
Ankush