2

How do I reset the root password in fedora ? Is there any way out ? I have googled a lot but couldn't find any useful result.

  • Do you just want to reset the password or do you not have it to begin with? – MaQleod Aug 1 '12 at 6:24
  • @MaQleod reset the password – Suhail Gupta Aug 1 '12 at 6:27
8

the Fedora documentation gives Information on how to reset the root password.

You can also use this more general approach here with init=/bin/bash which works on about any distro.

This is from the Ubuntu documentation:

  1. Reboot your computer

  2. Press SHIFT or ESC at the grub prompt (as earlier).

  3. Select your image.

  4. Highlight the line that begins kernel and press 'e' to edit

  5. Go to the very end of the line, change the ro to rw and add init=/bin/bash

press enter, then press b to boot your system.

Your system will boot up to a passwordless root shell.

  1. Type in passwd username

  2. Set your password.

  3. Type in reboot

This should work,too

| improve this answer | |
2

With sudo access:

When you at least have sudo access to the machine you can use sudo bash to aquire a root shell and passwd afterwards.

With chroot:

Another way would be to boot from a LiveCD (or USB Stick with a live System). Then you have to mount your system partitions. At least the ones containing /etc and the location of passwd, probably /bin check with which passwd. Afterwards you chroot into that directory.

 mount /dev/sda1 /mnt/system
 mount /dev/sda2 /mnt/system/etc
 chroot /mnt/system /bin/bash

Now you are virtually inside your new environment and can use passwd. Maybe you have to update your environment with hash -r before.

| improve this answer | |
1

This works in debian distros, should work in Fedora I think (assuming you have sudo privs)

sudo passwd root

type and verify the new password and done.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.