LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-10-2004, 09:29 PM   #1
Jazinator
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Rep: Reputation: 0
Help for Corrupted Root password


Hi all,

I had a power outage yesterday and the system shut down right in the middle of booting up. When the power came back on Linux would boot up, but I could not log in as root any more. somehow the password got corrupted or lost or something. It will let me log in as a user, but it won't let me change any configuration files or change the root password from there??. Is there anything I can do to repair this short of reinstalling the whole thing again??
 
Old 12-10-2004, 10:19 PM   #2
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
It would be easier if we knew what distribution you are using. You can set that in the User CP.

You can try using your install CD to boot. When you get to the point where it asks if you want to install there is usually an option to rescue or repair. If this works like it did with my distribution, eventually you will get to a command line where you can chroot to your normal / and then reset your password.

Bill
 
Old 12-10-2004, 10:25 PM   #3
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

Rep: Reputation: 34
With LILO or Grub, you may have the option to select "single". If you do, select it, and it will boot up into a console, with you as root. Then just type "passwd" to change it.

Otherwise, you may try booting with a linux bootable cd and mount the partition. Then you can generate the MD5 encrypted key via a console (or whatever encryption is used) and paste it into your /etc/passwd or /etc/shadow file (use the latter file if you have it) into the appropriate place.

Last edited by student04; 12-10-2004 at 10:28 PM.
 
Old 12-11-2004, 05:08 PM   #4
Jazinator
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks guys

I do appologize. I am using RedHat 9 (Shrike) distribution. I will try the suggestions that you have provided so far, if I still can't get it, I will let you know. Thanks again. Jaz.
 
Old 12-11-2004, 09:06 PM   #5
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
You should have no problem with either solution. Alex has a good suggestion with going into Single user mode. You can do that by temporarily editing grub during boot up. When grub comes up use the E key to go into edit mode. You'll see the lines that make up the boot commands. Edit the line with vmlinuz in it to include a 1 right after vmlinuz (see below). Then use the B key to boot. Once the command line comes up you can change the password on root with the passwd command.
Code:
	
	kernel /boot/vmlinuz-2.4.20-28.7 ro root=/dev/hda2 hdc=ide-scsi
	kernel /boot/vmlinuz-2.4.20-28.7 1 ro root=/dev/hda2 hdc=ide-scsi
Bill
 
Old 12-12-2004, 01:32 AM   #6
aunlead
LQ Newbie
 
Registered: Dec 2004
Posts: 1

Rep: Reputation: 0
was wonderin if above ^^^ method might also work with lilo???...or is it only for grub....
 
Old 12-12-2004, 09:17 AM   #7
Jazinator
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks Everyone

Thank you guys, that worked great and I learned something new. I was able to edit the Grub loader and boot into run level 1 and change the password. I am so greatful for this site and everyone here. Thanks again Mr. Makowski and Student 4 for you help. Jaz
 
Old 12-12-2004, 10:06 AM   #8
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
Jaz, glad to hear everything worked out. In my opinion this is one of the best sites out there for getting help with linux.

aunlead, I can't give you the exact steps for lilo, but I know it is possible to do the same thing. I know the latest version of lilo is not like the one I run on my old 386. In my version all I had to do was type linux 1 when it came to the lilo prompt and it would continue into single user mode. You might check out the LILO mini-HOWTO at the linux documentation project for more help.

Bill
 
Old 12-12-2004, 01:55 PM   #9
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

Rep: Reputation: 34
It was a pleasure to help.
 
  


Reply



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
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
Booting into Single User on MDK 9 asks for root password instead of booting into root acadcworks Linux - General 6 01-10-2006 06:51 AM
Logged in as root, prompted for root password ta0kira Slackware 13 04-25-2005 01:29 AM
Root password corrupted? phoenixleo SUSE / openSUSE 6 02-02-2005 12:11 PM
fatal error: root partiton corrupted, can't mount it, can't fsck it. qanopus Linux - General 15 01-31-2004 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:19 PM.

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
Open Source Consulting | Domain Registration