Linux Centos ver 5.6 -- Lost Root Password

sambec22 used Ask the Experts™
Does anyone know how to recover the root password?  The last Admin left the company and will not give us the root password.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

reboot into single user mode and use the passwd command

on boot, in grub screen, hit "e", and edit kernel command line, add "init=/bin/bash", then boot
after boot, you will automatically enter in root permissions.
Hi sambec22,

Here are the steps.

Boot your system.
Select the kernel
Press the e key to edit the entry
Select second line (the line starting with the word kernel)
Press the e key to edit kernel entry so that you can append single user mode
Append the letter S (or word Single) to the end of the (kernel) line
Press ENTER key
Now press the b key to boot the Linux kernel into single user mode
At prompt type passwd command to reset password:

I have answered the same issue here:

Umesh Panwar

If your grub configuration is password protected the mentioned commands to change to grub boot menu might not work.
In that case you an always boot using another boot CD of a Linux-Live-Distribution or Linux-Recovery-CD and then edit /etc/passwd or /etc/shadow by hand.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial