Solved

Forgotten root password

Posted on 1998-12-22
18
270 Views
Last Modified: 2013-12-06
I can't seem to get my root password to work.  I've tried all combinations of upper and lower case and have to assume I've mistakenly recorded what it was.
I can get in as another user with basic privledges.
How can I reset the root password?
0
Comment
Question by:chonsp
  • 7
  • 4
  • 2
  • +3
18 Comments
 
LVL 1

Expert Comment

by:mart010897
Comment Utility
It depends on what distribution you have, but what you want to do is boot from a floppy disk (Slackware you can use your boot disk; RedHat you can use a "rescue" disk) and get to a shell prompt.

Then mount your Linux's root filesystem somewhere like mount-- say your Linux root filesystem is on /dev/hda3, you would "mount -t ext2 /dev/hda3 /mnt".

Now you can edit the passwd file (vi /mnt/etc/passwd) on that filesystem.  Just remove the encrypted password from between the colons in the second field of root's line:

root:fjkhs897320:0:1:Super-User:/:/sbin/sh

becomes

root::0:1:Super-User:/:/sbin/sh

then remove the floppy and boot normally.  root's password will be null (you can just type root and get in).  Then change your passwd to something you'll remember!  :)

Good luck!

Mart

0
 

Author Comment

by:chonsp
Comment Utility
Its Red Hat release 5.2.  Of course I have not gotten around to a rescue disk as of yet.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
at LILO prompt: boot with single option

0
 
LVL 10

Accepted Solution

by:
rbr earned 200 total points
Comment Utility
You have to use a boot disc for linux. Boot your system with it and enter in with root without any password. Afterthis mount your HD and enter the /etc directory. In this directory edit the file passwd. You shoul find there a coded password for root. Delete this password and reboot without your disc from HD. After this you should have no root password and you can enter the system.
0
 
LVL 10

Expert Comment

by:rbr
Comment Utility
Almost every linux distribution is able to create a boot disc from DOS/Windows with rawrite. Search your CD for bootfiles (bootdsk.144, ...) Also a short help file how to generate a bootdisc from DOS/Windows should be available on your CD.
0
 
LVL 2

Expert Comment

by:gravity
Comment Utility
Did you shadow your /etc/passwd file ? I assume that you have no other users that you can log in as to change the file ?
0
 
LVL 1

Expert Comment

by:mart010897
Comment Utility

RedHat has a rescue disk available for download, I believe.  Remember, you don't need anything fancy, just a shell, an editor and the ability to mount a filesystem.  In fact, you can even use a set of Slackware boot and root floppies-- since you're not running the install program.

Good luck...

Mart
0
 
LVL 1

Expert Comment

by:mart010897
Comment Utility

Hey, rbr, why did you post the same answer as me as an answer, not a comment?  That's a breach of etiquette as I understand it.  We're supposed to post as comments until the problem is solved, then whoever the user decides helped most posts the answer and gets the grade.  You posted my same answer after me.  If you get points for it, I won't like it.

Mart

0
 
LVL 2

Expert Comment

by:tschill120198
Comment Utility
Where are the instructions as to what is proper etiquitte?  My undestanding was that if a question hadn't been answered (with an "answer" response, not a "comment") it was open for anyone to answer.  If you were proposing an answer/solution, it should be submitted as an answer (locking it from other answers); if the answer wasn't "good enough", it would be rejected and the question opened up for answers again.

Why did you submit your original post as a comment, rather than as an answer?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 1

Expert Comment

by:mart010897
Comment Utility

The idea as I read it on the board before is that when you submit an answer, no matter how bad the answer is, it locks the question, and prevents a more qualified answer from being given, as the question will no longer show up in the "waiting for answer" list.

I posted as a comment, as I always do, to leave the question open in case someone with a better answer came along.  It should be up to the user to choose which answer suits him best.  

As you can see above, rbr's "answer" is much less descriptive than my comment, even though it describes the same procedure-- but my comment was posted first.  If my comment had solved the user's problem, I would have then posted it as an answer and allowed him to grade it.  

rbr's answer forces the user to reject the answer if any of the comments from other experts solved his problem.  It's also unfair to me because rbr can now get points for basically parroting my comment as an answer.
0
 
LVL 2

Expert Comment

by:tschill120198
Comment Utility
If the answer is "bad", it will be rejected and re-opened for answering.  You'll then have your chance to answer it and get your points.  In the meantime, you can still post your comments and help out.

The way I see it, if you think you have the answer or a solution, post as such.  Keeps the process simple.
0
 
LVL 1

Expert Comment

by:mart010897
Comment Utility

Hmm.  Doesn't seem fair to me.  Seems to me an expert's goal should be to help the user, not to garner points by whatever means necessary.  The comment approach seems to me to encourage better answers, since the user can then simply pick the best one.

0
 
LVL 2

Expert Comment

by:tschill120198
Comment Utility
mart-
I asked customer service about whether to "answer" or to "comment"... see "http://www.experts-exchange.com/Q.10111433" for the response.
Thanks.

0
 
LVL 2

Expert Comment

by:gravity
Comment Utility
It's still not on, though.

If I were you, Consp, I would reject rbr's answer. That way, solve arguments easily.
0
 
LVL 2

Expert Comment

by:tschill120198
Comment Utility
Agreed.  rbr's answer is the same as mart's...
0
 
LVL 1

Expert Comment

by:mart010897
Comment Utility

Oh wow, I didn't know about that auto-grading.  That's even worse.

0
 

Author Comment

by:chonsp
Comment Utility
I think I'll let this go with a passing grade and let the net-iguitte lesson be learned.  Enough time spent on this.
0
 
LVL 1

Expert Comment

by:mart010897
Comment Utility

Thanks a pantload, rbr.

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now