Recover root password - Fedora 8

I've managed to change the root password. To what? I have no idea.

What I've tried so far, to recover it, is:

> Insert Fedora disc #1
> Select the Rescue Mode
> [After selecting <yes> a few times] get to a console

1)  (now try the solution suggested here: http:Q_22495405.html)

> Type:  passwd root

    But the output is:
    passwd: unknown uid 0

2)  (try the solution here:

That is:

> cd /etc
> vi passwd
> i
   (The only line that appears is:  root:0:0:root:/:/bin/bash)
> Esc + ZZ
> vi shadow
> i
   (This file is completely empty)

It would seem that I still have limited access, even when I boot to a console via the Installation disc.

Any suggestions?

Thanks very much

(P.S. I have about 4 hours of experience with Linux - so please be gentle)
LVL 25
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Judging from what the output was on attempt 1, I'd say that the root account may have been corrupted. Not sure how that happens but you can try doing this (not sure if it will work).

login into fedora as a normal user.
open a terminal
type: su
press enter when prompted for a password.

If you managed to log in as root, then the password was blank and from here you can type
and change the password accordingly.

If that didn't work then try this:

If all else fails....reformat


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
if the system does not respond to such tricks then you can try and do a reinstall of the OS with minimal selection

select the option NOT TO FORMAT THE PARTITIONS.  this is very important as formatting any partitions would be disastrous and leads to loss of stored data.  

when you do a minimal installation, it automatically sets the accounts straight without overwriting any of the data or config files
Kerem ERSOYPresidentCommented:

There's something missing in the explanation above. To change the root password ou need first:
- Boot from the CD
- In the ":" prompt type "linux rescue" and hit enter.
- Once the reboot is complete you should have your system is mounted under /mnt/sysimage
- Make it your root using your system:
chroot /mnt/sysimage
- Only after thet you might be able to change your root password in your hard disk. another alternative is to edit your /etc/shadow and delete the password inside the file. The line should read something like that initially:

once youe done editing it should look like that:


Save & exit & reboot
now you should be able ro login using root
and without password. Just set a new password.

Get a highly available system for cyber protection

The Acronis SDI Appliance is a new plug-n-play solution with pre-configured Acronis Software-Defined Infrastructure software that gives service providers and enterprises ready access to a fault-tolerant system, which combines universal storage and high-performance virtualization.

Alternatively, just fire up the machine, then at the Grub bootloader screen, select the option to edit the boot line and put a 1 at the end of it. This will load the OS to run level 1 and drop you to a root shell without requesting any login credentials. At this point you can simply use passwd to change the root user's password.

> If all else fails....reformat

No no no no no. That's "the windows way", and it helps noone. Fix the problem and LEARN something, don't simply whitewash over it.
Kerem ERSOYPresidentCommented:
> vi shadow
> i
   (This file is completely empty)

For you told so you might fill it this way:
InteractiveMindAuthor Commented:
Problem solved.
Suffice to say: I'm a long-term Windows user. So a reinstall is what I went for.
Next time this [inevitably] happens, I will hopefully have the time to figure it out.

Thanks for all input.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.