Saturday, March 28, 2009
Tuesday, March 3, 2009
Reset the root password on a linux box
Intro
The following steps were used to successfully reset the root password of a "Fedora 10" machine. In general, can be applied to any linux machine.
- GRUBWhile booting, after the initial splash and POST screen of the bios, the control transfers to GRUB. If there is just one linux operating system installed, the GRUB screen is bypassed to the booting screen, in that case just keep on pressing or tapping the ESC Button until you see the GRUB Menu.
- Edit Choose the OS you want to boot into and press "e" to edit.
- Edit Find the line that corresponds to kernel, and again press "e". Add the following line to the end of the line.
single init=/bin/bash
Then press enter, and then "b" to boot the OS. After booting you will get a root shell. - Mounting the filesystem in readwrite mode: Type in the following command to remount the filesystem in read write mode.
mount -o remount,rw /
- passwd Next just use the passwd command, and give a new root password, Now that's simple.
- Reboot or init 5
Not doing this step might give the following error when running passwd, passwd: Authentication token lock busy.
That's really all I did.
OR from the root shell, you can also edit the /etc/shadow file to remove the password.
OR copy the /etc/shadow /etc/passwd file and use John-The-Ripper software to try cracking the password.
Stuck? Let me know...
.___.__ .__ __ .__ ___. __
__| _/|__| ____ |__|/ |______ | | ______\_ |__ | | __
/ __ | | |/ ___\| \ __\__ \ | | \____ \| __ \| |/ /
/ /_/ | | / /_/ > || | / __ \| |_| |_> > \_\ \ <
\____ | |__\___ /|__||__| (____ /____/ __/|___ /__|_ \
\/ /_____/ \/ |__| \/ \/
a8888b.
d888888b.
8P"YP"Y88
8|o||o|88
8' .88
8`._.' Y8.
d/ `8b.
dP . Y8b.
d8:' " `::88b
d8" 'Y88b
:8P ' :888
8a. : _a88P
._/"Yaa_: .| 88P|
jgs \ YP" `| 8P `.
a:f / \.___.d| .'
`--..__)8888P`._.'
Posted by Arun Prabhakar at 4:19 AM 24 comments
Subscribe to:
Posts (Atom)