Page 1 of 1

Don't forget your root password!

Posted: 2005-08-18 03:22am
by Stark
The professionals at our local energy provider chopped a tree down because it was overhanging powerlines, and it of course fell the wrong way and killed my grid. So by the time I wake up, my backup power is gone and my network is down.

Turns out sometime (perhaps on some security bender) I changed my root password and don't remember it. Samba isn't set to start on boot (grr) and I can't start it without root access.

Now I need to update my server anyway, and I've got FC4 sitting here: what's the least-painful way of setting a new root password with complete physical access to the server? Would running a 'minimal' FC4 install allow me to set a new root password?

Posted: 2005-08-18 04:37am
by Faram
What OS do you have?

Posted: 2005-08-18 05:13am
by Stark
Sorry, Fedora Core 4.

Posted: 2005-08-18 10:17am
by phongn
Boot into single-user mode.

Posted: 2005-08-18 11:41am
by Pu-239
Don't you still need the password to login to single user (Fedora may be different though- I'm using Debian)?

I'd suggest using a bootdisk (Knoppix), and try chrooting to the filesystem "chroot /mnt/" (I'm assuming you have everything under one partition, or at least /bin, /sbin, and /etc), and running "passwd" from there.

If you can't figure out how to do that, depending on whether PAM is set to allow null passwords, you can edit /etc/shadow- change the first line from

Code: Select all

root:[some gibberish between the two colons]:12988:0:99999:7:::
to

Code: Select all

root::12988:0:99999:7:::
(Note: numbers may be different)
and try rebooting and logging in normally w/ a blank password

Obviously you have to be root on the instance of Linux on the bootdisk to do the stuff listed above.

Posted: 2005-08-18 10:18pm
by Darth Yoshi
Well, for Redhat, anyway, single-user doesn't require a password.