Solved

Forget root Password

Posted on 2004-04-12
7
1,122 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Save file from one Ubuntu machine to another? 7 86
How to analize a machine with a NIC? 9 121
Linux integration host into ADDS for SSO using kerberos 3 70
IRQD Load 34 181
​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…
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

739 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