[sf-lug] recovery from loss of root password
Alex Kleider
a_kleider at yahoo.com
Tue Sep 18 19:07:42 PDT 2007
Thanks to all who came and made yesterday evening's meeting such a good
one, for me at least.
I submit the small item I brought up since the solution _might_ be of
interest and because there are still some unanswered issues which some
one (Michael perhaps) might like to address.
Recovering from loss of root password:
There are a couple of documented methods of recovering when a root
password is forgotten:
1. if boot loader is lilo, the boot: Linux init=/bin/sh option is
supposed to provide a shell with root privileges and further details
are documented in the Debian tips chapter (8) of the Debian Reference
Unfortunately this is of little use since Debian now uses GRUB, not
LILO.
Preliminary question: is there an equivalent GRUB boot option?
2. also from Debian Reference is the second method using "any emergency
boot/root disk set." I _assume_ that the Debian netinstall CD should
serve the purpose. ..so the first question becomes is this a valid
assumption?
One can "Execute a Shell" from the Debian installer main menu. If that
option is chosen, one is told that "ash" is being offered, the root
file system is a RAM disk, nano is available as an editor and the hard
disk file systems are mounted on "/target".
An ls command however shows no /target entry.
So the second question: Is the notice just plain wrong?
Also, after executing
# mkdir fixit
which does what it should, the following
# mount /dev/hda1 fixit
yields the error:
mount: Mounting /dev/hda1 on fixit failed: Invalid argument
I've no idea what the invalid argument could be.
There is also a /.dev directory but using /.dev/hda1 yields the same
result.
Can anyone shed light on this?
Next installment (after problem solved:)
I downloaded the Gentoo (vs. Debian) install iso, burned a CD and
booted from it,
then the # mkdir fixit followed by # mount /dev/hda1 fixit all worked.
After that it was a simple matter of deleting the root password entry
in
/etc/shadow
and finally # shutdown -r now
remembering to get the Gentoo CD out of the drive in time.
It remains a mystery why the Debian install CD doesn't work the same
way.
alex at kleider.net
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.
http://mobile.yahoo.com/go?refer=1GNXIC
More information about the sf-lug
mailing list