Solved

Forget root Password

Posted on 2004-04-12
7
1,099 Views
Last Modified: 2010-04-22
Hi to all...

I forget the root password, could I back to it without reinstalling?
I'm using Fedora Linux

Thanks
0
Comment
Question by:programmer_bmb
7 Comments
 
LVL 6

Accepted Solution

by:
karlwilbur earned 20 total points
ID: 10811056
It is not possible rto recover a lost password.

The easiest way to handle this that I know of is to reboot into single user mode or to a command line
Using lilo you'd do this:

lilo: linux single

or

lilo: linux 1

this may still require a password though,  if so try:

lilo: linux init=/bin/bash

if you're not using Grub instead of lilo, you'll have to edit the grub command from the boot menu to pass init=/bin/bash to the kernel.

Then from the command line type:
fsck /
mount -orw,remount /

then edit /etc/passwd and remove the password (making it blank).

root:I4ecBSBzgWj8Y:0:0::/root:/bin/bash
       ^^^^^^^^^  This is the password  (we'll not the actual password, it's kind of encrypted)

You might even see
root:x:0:0::/root:/bin/bash

in which case, delete the "x".  Just delete what ever is between the colons.

The fields in the /etc/passwd file are like the:
username:password:userid:groupid:/home/dir:/path/to/shell

-Karl
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10817731
After potentially remounting the root partition, you should be able to use the passwd command. There is no need to modify the /etc/passwd file with an editor.
0
 
LVL 1

Expert Comment

by:Sachin_Yash
ID: 10857742
HI !!!

       To recover your password just take down folloing steps...

      1. Restart your pc & on boot screen (either GRUB or LILO loader) just press 'e' you will see another screen where u just press again 'e' & after the given line which look's like
       " kernel /vmlinuz-2.... ro root=LABEL=/ "
           after one space insert '1' after '/label=' sign.
      2. Press enter & after u will again see the second page here u have to press 'b' & u will get superuser
prompt i.e.  
         sh-2.05b#

      3. Give command as
           sh-2.05b# passwd root
          linux will ask for new password ..just give it & your problem is solve...
          just reboot the computer....
      4. Select normal bootup & give modify root password...

       
0
 
LVL 2

Expert Comment

by:sam_sunder
ID: 10948196
hi

you can also boot with the cd and go to rescue mode.

you whole system will be mounted on mnt/sysimage (you will get a dialog box saying where it is mounted)

traverse to /etc/password.  at the root user remove * in the second field save the file and reboot. you can login without password. and then you can set the password by using passwd command.

regards,

sam
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12056219
Points to karlwilbur
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

13 Experts available now in Live!

Get 1:1 Help Now