LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   I Forgot my root password (https://www.linuxquestions.org/questions/linux-distributions-5/i-forgot-my-root-password-188353/)

Hamid Moradmand 06-01-2004 04:38 AM

I Forgot my root password
 
Hi there!

I forgot my root password and I don't have any password else.
What should I do for entering?

Thanks for your help!!!

SBing 06-01-2004 05:08 AM

I think you're gonna have to format, (but you don't have to lose important data, see below) if there is only one user on your machine (which there shouldn't be really, you should have at least one "normal" user aside from root) there is very little you can do to get in.

The password to root will be stored in encrypted form so unless you've got a really easy password I wouldn't bother trying to brute force decrypt it. Apart from a remote machine root exploit, I doubt it is going to be easy to get in.

What you could do of course if you don't want to lose data is:

Boot of a Linux Live CD (There are plenty of them out there)
Mount your hard drive
Copy the data you need to CD-R, other harddrives or another computer

Then format the hard drive and reinstall, this time don't forget your root password and create a new user. If you have a really bad memory and your computer isn't a server, then you may as well write it down somewhere safe :)

Steve

Edit: lack of coffee, yes there are a few ways of doing it - followed below...

XavierP 06-01-2004 05:11 AM

Do a search for "linux-single" - if you haven't put measures in place to prevent it from being used (and you haven't already reformatted) that will tell you how to change the root password.

linuxzouk 06-01-2004 06:31 AM

no need to reformat, try

http://kitech.com.my/fedoraguide/#changerootpassword

it applies to red hat too

smaida 06-02-2004 01:45 PM

If you are using redhat just boot from the redhat cd "disk 1" and choose recovery mode. You should be a ble to get to a linux shell at which point you want to locate your /etc/shadow or /etc/passwd file and find the line that looks like:
root:$2$6Fhe48fjFsSSkcms.e4SDjcDD:12546:0:99999:7:::

Change the line to look like root::12546:0:99999:7:::

You should then be able to login without a password.


Shawn


All times are GMT -5. The time now is 01:24 PM.