I have an Oracle VirtualBox VM, with FedoraClient 21 64-bit installed. I cannot remember the root password. As soon as I start up Fedora, I see two options of Fedora: "Client" and "Rescue". Both all start up and leaving me at localhost login.

Is there a way to reset the root or local login password before it reaches to the localhost login prompt?


Reset Password Using a Fedora CD/DVD:

Usage cases
This method should work to reset the root password if the boot loader is password protected.  Or if you have a Fedora 19 (or newer) installation where booting to the rescue mode (which now invokes /sbin/sulogin) will ask you for the root password to proceed.

Using any of the Fedora Live Media

  • Boot the Live installation media

  • After it finishes booting and starts the live session, open a terminal and switch to root (using su, it won't ask for a password)

  • Create a directory where you can mount the filesystem of your installation:
    mkdir /mnt/sysimage

  • Mount the filesystem of your installation (/dev/sda1 is just an example, be sure to fill in the actual device node of your installation root / partition):
    mount /dev/sda1 /mnt/sysimage

  • chroot to your installation:
    chroot /mnt/sysimage/

  • Change the root password:

  • Exit from the chroot:

That's it, simply reboot your system and then boot the installation from the HDD as usual.

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.