Operating System - Linux
1748121 Members
3261 Online
108758 Solutions
New Discussion юеВ

forgot root password in Linux

 
logaraman
Regular Advisor

forgot root password in Linux

I have installed RHEL ES-4 in a server and have forgotten the root password. I have tried going into the single user mode and appened the OS as "ro root=LABEL=/ single" . but i get the below error and am not able to go into single user mode.. the error is "Kernel Panic- not syncing: Attempted to kill init" ...

Any suggestions pls
4 REPLIES 4
debian111
Regular Advisor

Re: forgot root password in Linux

Hi,

find some live linux distribution like trophix ( my favorite ) knnopix, or some else, reboot your machine and put live cd in cdrom, when system boot up find disks on your mashine..
fdisk -l and ( you know where it is located ) edit /etc/passwd for your RH server ( this is place for users passwords on Debian and I think it is similar on RH, ) I mean there is line for root something like

root:x:0:0:root:/root:/bin/bash

edit this line ( using nano, vim ....your choice) you should erase x in this line ... save exit ....reboot machine ( take out live cd from cdrom before booting ) and I think now it wont ask you for root password .....

::)))

Do not forget to change root password and do not forget it again ::)


Regards

Debian111
Senthil Prabu.S_1
Trusted Contributor

Re: forgot root password in Linux

Hi,
The extact procedure that has to be followed to change the root password, if you lost the password is given in the below link;

http://aplawrence.com/Linux/lostlinuxpassword.html




HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Steven E. Protter
Exalted Contributor

Re: forgot root password in Linux

Shalom,

Boot off rescue or a cd based distribution and null out the password field for root.

Then reset and remember the root password.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com

Re: forgot root password in Linux

Make sure there is a space between the ending / and the word single, S, or 1, on the line beginning with kernel otherwise you will get this panic msg.