LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-07-2003, 09:39 AM   #1
art15t
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Rep: Reputation: 0
reset unknown root pass in redhat


Hi all,

I know how to do this with SuSe but I haven't had much exposure to Redhat.

Can you boot with the install CD and mount the appropriate partition to gain access to /etc/shadow or is there a quicker way with Redhat or any other ideas?

ART
 
Old 10-07-2003, 09:51 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
If boot parameters are allowed in lilo, you can drop directly into maintance-mode(=runlevel 1) by booting "linux 1" (that is if your bootloader (lilo/grub)-choice is named as linux).

Some distributions (I don't know about redhat) have yet another root password query at the point of dropping into the maintanance mode, so it might have to be done in the hard way.

"linux init=/bin/sh" should drop you into the prompt where you can remount the root-partition to readwrite-mode
Code:
mount -o remount -w /
and run the "passwd" command.
 
Old 10-07-2003, 10:17 AM   #3
art15t
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Cheers for that!

**POST FULFILLED**

ART
 
Old 10-08-2003, 04:06 AM   #4
art15t
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
reset unkown root pass

Thought I'd let you know how I did this seeing as ToniT's method failed (no offense to ToniT and thanks for the help). The offending server was running Redhat but I managed to fix it using my SuSe CD's 1 & 2.

Make a note of which partition contains /etc before you begin.

1) Insert disk2(expert disk) into CDROM and hit the reset button to reboot
2) when prompted select country and colour for display.
3) Select "start installation"
4) Select "Rescue System"
5) select "From CD"

let the kernel image load and you are finally prompted for the root pass......just press return and you will be at the root prompt, but......you're not home just yet.

Mount the internal hdd partition containing /etc with

mount /dev/hda? /mnt
mv /mnt/etc/shadow /mnt/etc/shadow.bak
init 6

Remove the CD from CDROM drive and wait for the system to start up. It will start to fsck the partitions and finally halt because the shadow file is missing, prompting you to either ctrl-d or enter the root pass, just hit return and bingo you're at the root prompt.

mv /etc/shadow.bak /etc/shadow
passwd ......reset the root pass
init 6

Cos if you don't have the SuSe disks perhaps someone else could offer an alternative with the Redhat or other distributions.

ART
 
Old 10-08-2003, 11:03 AM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
To be curious, why my method failed? Because the bootloader didn't allow you to assing boot-parameters or because you could not gain write-access tho the partition containing /etc or because the passwd command failed?

The first one could be possible if the bootloader is made too secure, second if there is some syntax problem in the mounting.
The last one could be possible for example if the passwd needs /proc to be mounted (mount -t proc proc /proc) or some other detail I forgot.
 
Old 10-09-2003, 02:59 AM   #6
art15t
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Hi ToniT,

I could not stop it loading Xwin even with the boot-params you suggested, as you say maybe the boot loader is too secure. That was with the Redhat 6.1 disc. So I switched to plan B and used me old SuSe discs.

"linux 1" was accepted as a valid boot param but still continued to Xwin with no way of halting it mid process, the same went for "linux init=/bin/sh".

ART
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rpmbuild --with : mysql - unknown option. How to pass extra options to build? fireman949 Red Hat 0 07-06-2005 07:53 PM
Lost root pass word luckyvietman Linux - Newbie 11 06-01-2005 10:13 AM
root pass blank/redhat9 rohan208 Linux - General 3 05-07-2004 06:06 PM
MySQL root pass tommytomato Linux - Newbie 0 02-02-2004 07:34 AM
Forgot MYSQL root pass jon_k Linux - Software 2 07-25-2003 02:03 AM


All times are GMT -5. The time now is 04:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration