This is not a security issue (or at least keeping the solution "secret"
isn't one -- it's too well known -- anyway, everyone *should* know this for
use on their own systems). The procedure is akin to something we were
discussing on another thread yesterday -- you don't "recover" the root
password, but you do remove it.
Actually, there are a couple of methods that should work.
If you can, when the system boots, type "linux single" and see if that puts
you into single-user mode. If it does (this may or may not work depending on
the details of how you did your install, and the magic word might not be
linux - it will be something you chose when you configured LILO), then you
can edit either /etc/passwd or /etc/shadow (depending on whether or not you
are using shadow passwords) to remove the root password. (Edit with vi or
whatever you prefer. I don't recall what single-user mode sets up as a
default PATH in the environment, so you may have to enter the full pathname
for the editor.) Then boot up normally, login as root, and set a new root
password.
If that doesn't work, you'll need to boot the system from floppy. Here are
the steps.
1. Set the system BIOS so the boot sequence is A:,C: .
2. Boot the system with a bootdisk in the floppy drive. You don't want a
"rescue" disk here - that is, one that boots a kernel but then sets up your
Linux hard disk partition as the root. You want something like a Slackware
bootdisk-rootdisk set, or tomsrtbt, which creates a root filesystem in a
ramdisk. This disk or set should be one that lets you log in as root without
a password (as the Slackware ones do).
3. Mount your hard disk root partition. The exact command will depend on the
details of your system, but it will look something like:
mount /dev/hda1 /mnt
4. Assuming step 3 is successful, cd to /mnt/etc and edit either /etc/passwd
or /etc/shadow (depending on whether you have shadow passwords installed or
not). In the appropriate file, change the root password to be blank. (You
edit with a text editor like vi. You will probably have to enter the full
pathname of vi, or whatever you use, as this procedure will have messed up
PATH assumptions.)
5. Take the computer off any network it is connected to (for security
reasons, while you do the next step).
6. Reboot the system, login as root (should be no password needed), and
create a new root password.
7. Once you know that all is well, switch the boot sequence back to whatever
you had before and reinstall any network connection.
Now I've obviously made a lot of assumptions about your system here ... that
it's an Intel-based system, that it uses an IDE drive, that the linux root
partition is the first partition, and so on. You will need to adjust the
instructions to correct for any of those assumptions that are incorrect.
Good luck. Hope this helps.
At 06:53 PM 5/4/99 -0400, J. D. Kent wrote:
>OK, I blew it. I goofed big time.. *sigh*
>
>I have a stand alone system at home that I am using to learn Linux with.
>Due to several things going on, I haven't used the system in over a
>month. I remember my user account password, but have forgotten my root
>password. And of course, the piece of paper I had them written on has
>mysteriously vanished.
>
>Therefor, the question is, is there some way to recover my root
>password, other than wiping out and reinstalling the system?
>
>Since this could be an obvious security risk, please respond directly to
>my e-mail address rather than posting to the list.
------------------------------------"Never tell me the odds!"---
Ray Olszewski -- Han Solo
762 Garland Drive
Palo Alto, CA 94303-3603
650.328.4219 voice [EMAIL PROTECTED]
----------------------------------------------------------------