View Single Post
Old 9th October 2005, 00:40
themachine themachine is offline
Senior Member
Join Date: Oct 2005
Location: Texas, USA
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default /bin/bash it!

Just a reference for anyone else reading this... you can just as easily change root's password with out the use of a LiveCD.

reboot the box
at the boot loader do the following:


linux init=/bin/bash


type 'e' to edit the default kernel line
then 'e' again on the line that starts with 'kernel'
add 'init=/bin/bash' to the end of the 'kernel' line
type 'b' to boot it

once you're at a /bin/bash prompt...

remount the filesystem read/write (will be ro when bin/bash'ing)

# mount -o remount,rw /

then change the passwd

# passwd root

remount the filesystem read/only (keep things clean)

# mount -o remount,ro /

CTR-ALT-DELETE (though this will result in a kernel panic most likely)

reboot the system and you should be good to go.

This however will not work if you've locked down the boot loader and have misplaced that password as well.
Reply With Quote