1819802 Members
3042 Online
109607 Solutions
New Discussion юеВ

Password Recovery

 
JR Garcia
New Member

Password Recovery

This is my first experience with Linux and I just started this job as IT / Systems Manager. I discovered that I have an external ( register )DNS server on a Linux REDHAT 7.0 platform. Unfortunately the previous systems manager didn't have any documentation. I need to know how to recover the root password without re-installing ? Does anybody have a suggestion....Thanks in advance....
Always finding a solution to a problem
3 REPLIES 3
Kodjo Agbenu
Honored Contributor

Re: Password Recovery

Hello,

Here are 3 methods :

1. The easiest one : reboot your system in single-user mode, cancel the root password, and reboot normally to set another one.

To boot single-user, at LILO prompt type "linux s".

Some Linux distributions require root password to enter single-user. If it is your case, try the second method.

2. The most difficult one : reboot your system with a recovery CD-Rom or disk, mount the root filesystem and cancel the password.

It is not so difficult, but you need some Linux expertise. Just to summarize : boot on the Install CD just as if you wanted to re-install, go through the steps until keyboard and language selection, then type CTRL-ALT-F2 to open a shell.
Then :

mkdir /new
mount /dev/your_root_partition /new
/new/usr/bin/vi /new/etc/passwd

Clear the password field.

Then, umount the root partition :

umount /new

To reboot : remove the install CD-Rom and/or floppy, then CTRL-ALT-DEL.


After reboot, don't forget to set a new root password.

Good luck.

Kodjo

Learn and explain...
Bill McNAMARA_1
Honored Contributor

Re: Password Recovery

Single user mode is the best way.

If you have a rescue floppy this is no problem.

You cannot recover the password but can change it.

You'll get a login without a prompt.

As a security note, password protect your bios (and don't forget it) and lock your box so you can't jumpt the BIOS paasword (and don't lose the key)

;)

Later,
Bill
It works for me (tm)

Re: Password Recovery

The easiest way is to boot into single user mode by feeding lilo "linux single". Once you're in single user mode, simply change the password just as you would any other time (assuming your root password is local... and it should be!)

If there is a lilo boot password set, you'll have to go around lilo. I recommend booting to the installation CD and typing "linux rescue" at the prompt. This will boot your system into a command-line recovery shell. It should also mount your old filesystem. The output that is given during boot should be enough to get you on your way.

If there is a BIOS password set, look up the motherboard specs online, crack open the case, and short the cmos reset pins to wipe out the old password.

Hope this helps. :-)