Changing root password in Fedora 34

I am using Fedora for almost 20 years. I have Fedora 34 and I wanted to change the root password. I used: “How to Reset the root Password :: Fedora Docs” procedure “In Rescue Mode”. It goes to prompt: bash-5.1#, I typed “passwd” for the new password. It changed to the new password with no problems and successfully. I rebooted with: “/sbin/reboot -f”, my computer reboots and now it doesn’t understand any password. I tried the procedure a few times and still doesn’t work. I used for the username the “root” and for password the new successfully installed password. What is wrong in here? Thank you.

1 Like

Sounds like you missed the part about repairing SELinux labels.


Why not just

sudo passwd root

(It requires a user in wheel group that can use the sudo command)


Hi Vladislav,

Yes you were right, now I can login into my Fedora 34.

How we say when something happens right: BINGO!

Thank you very much for your advice.

This is what I did:

  1. Reboot the PC and when GRUB appears hit the “e” key.
  2. At the end of line with: linux … I put a space and then I typed: rw init=/bin/bash and pressed F10.
  3. The prompt I get is: “bash-5.1#
  4. bash-5.1# passwd
  5. bash-5.1# New password: I typed: whatniceadvise
  6. bash-5.1# Retyped: whatniceadvice
  7. Restore SELinux … I just typed:
  8. bash-5.1# touch /.autorelabel
  9. bash-5.1# /sbin/reboot -f
    My computer rebooted OK, it did some SELinux… stuff then I’ve got the small window with the password.
    I typed: “whatniceadvice” and I could see all my work now, as it was before!!!
    Thank you again!! Saved me a lot of time…