Solved

Forgotten root password

Posted on 1998-12-22
18
272 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
ID: 1638910
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
ID: 1638911
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
ID: 1638912
at LILO prompt: boot with single option

0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 10

Accepted Solution

by:
rbr earned 200 total points
ID: 1638913
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
ID: 1638914
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
ID: 1638915
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
ID: 1638916

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
ID: 1638917

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
ID: 1638918
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
 
LVL 1

Expert Comment

by:mart010897
ID: 1638919

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
ID: 1638920
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
ID: 1638921

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
ID: 1638922
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
ID: 1638923
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
ID: 1638924
Agreed.  rbr's answer is the same as mart's...
0
 
LVL 1

Expert Comment

by:mart010897
ID: 1638925

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

0
 

Author Comment

by:chonsp
ID: 1638926
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
ID: 1638927

Thanks a pantload, rbr.

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

775 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