Help - Search - Members - Calendar
Full Version: Need Help From An Expert!
Linuxhelp > Support > Technical Support
I need help from someone who really knows what they are doing!!!! I have recently gotten a linux box and have somehow changed the root password, and am stuck with only a user with no privliges. Neither my cd-rom or my floppy disk are mounted right now... so how can I get my passwords back. Help please!!!
Please e-mail me back at
Okay... I just tried this on my system, and it should work. You're going to need a bootable distro of linux (ie the install CD for your distro, maybe), and you're also going to need to know what partition linux is installed on (/dev/hdxn, where x is a letter (probably a) and n is a number. You can get this by taking a look at your fstab file. There should be something like the following
/dev/hda3  /  ....

But it won't necessarily start with /dev/hda3. What you're looking for is the line with just the / in the second column (your root partition).
Once you've booted from your bootable linux distro, login as root. Mount your root partition:
mount /dev/hda3 /mnt

Then backup your current /etc/passwd file, the one for the bootable distro, and copy yours to the position of the one for the bootable distro:
mv /etc/passwd /etc/passwd.backup
mv /mnt/etc/passwd /mnt/etc/passwd.backup
cp /mnt/etc/passwd.backup /etc/passwd

Then change the password for root:
passwd root

It will ask you to change for the new password. If it says its too weak, make a new one OR just type it in again to use it. Now, copy the passwd file back to your distro:
mv /etc/passwd /mnt/etc/passwd

Reboot into your installed distro. If all went well you should be able to login with the password you just changed it to. I can't guarantee that this will work on your system, but it worked on mine. Hope this helps.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.