From Fedora Project Wiki

Revision as of 04:19, 30 March 2009 by Sundaram (talk | contribs)

Setting up root password is a mandatory part of a Fedora installation. If you forget your root password, there is a way to reset it. Note that if you have set a password for your boot loader refer the next section. If you have encrypted your hard disk as well during installation, it is more difficult to do so and this document doesn't cover that scenario.

Fedora uses run levels to determine the services being run when you start your system. Run level 1 is used as a recovery mode. Booting Linux under runlevel 1 or single user mode will allow you to reset your root password and you will directly get a root prompt on bootup. It is very easy to reset the password after that.

Entering Recovering Mode

While you system is starting up, press escape to see the bootloader called GRUB. After you see the menu,

   * use the arrows to select the boot entry you want to modify.
   * press e to edit the entry
   * use the arrows to go to kernel line
   * press a or e to append this entry
   * at the end of the line add the word single (or number 1)
   * press ESC to go back to the parent menu
   * press b to boot this kernel

You will see a series of text messages scroll by and you will get a root prompt with the text shell prompting for your commands(#).

Changing root password

As root, changing password does not ask for your old password. Run the command:

# passwd

Enter your new root password twice. Congratulations! You now have now reset your root password. You can type reboot and press enter to restart your system.

Reset Password When Boot Loader is Password Protected

Boot from the install or rescue CD/DVD

Select "Rescue installed system"

Answer the prompts for language and keyboard.

Starting the network is optional and not needed.

Let the rescue mode mount your file systems in the r/w mode.

Hit enter to get the shell prompt.

# chroot /mnt/sysimage (Change to your disk file system.)
# passwd               (Change the root password.)
# exit                 (Exit the chroot environment.)
# exit                 (Exit the rescue mode.)

The system will now unmount the file systems and reboot.