From Fedora Project Wiki

m (replace "recovery" with "rescue" since going to single user mode basically tells systemd to start rescue.target)
(add a section about using GRUB2)
Line 1: Line 1:
Setting up a root password is a mandatory part of a Fedora installation. If you forget or otherwise lose your root password, there are procedures to reset it.
 
* If you have set a password for your boot loader, refer to [[#bootloader-protected | this section]].
 
* If you want to reset the boot loader password, refer to [[Reset_Bootloader_Password | these instructions]].
 
* If none of these scenarios apply to you, proceed to [[#Entering_Rescue_Mode | the next section]].
 
 
Fedora uses ''run levels'' to determine the services being run when you start your system. Run level 1 can be used as a rescue mode. Booting Linux under run level 1, which is also called ''single user mode'', will display a root prompt on bootup, from which you can reset the root password.
 
 
 
== Entering Rescue Mode ==
 
== Entering Rescue Mode ==
 
+
=== Using GRUB legacy ===
While you system is starting up, hold down the ''Ctrl'' key or ''Esc'' to see the boot loader menu. After you see the menu:
+
{{Admon/note|GRUB legacy was the default boot loader up until Fedora 15.}}
 +
While your system is starting up, hold down the ''Ctrl'' key or ''Esc'' to see the boot loader menu. After you see the menu:
 
* Use the arrows to select the boot entry you want to modify.
 
* Use the arrows to select the boot entry you want to modify.
 
* Press ''e'' to edit the entry.
 
* Press ''e'' to edit the entry.
Line 19: Line 13:
 
A series of text messages scrolls by and after a short time, a root prompt appears awaiting your commands (#).
 
A series of text messages scrolls by and after a short time, a root prompt appears awaiting your commands (#).
  
{{admon/note | Encrypted partitions | If you have an encrypted partition, you are prompted for the pass phrase before mounting the filesystems. If have more than one encrypted partition and they all share a global pass phrase, select the option for global pass phrase. Otherwise, enter the pass phrase separately for each partition.}}
+
=== Using GRUB2 ===
 
+
{{Admon/note|GRUB2 has the default boot loader since Fedora 16.}}
== Changing root password ==
+
While booting the system the GRUB2 menu will be displayed, to boot into the rescue mode follow these steps:
 
+
* Use the arrow keys to select the boot entry you want to edit
As root, changing password does not ask for your old password. Run the command:
+
* Press '''e''' to start editing that entry
<pre># passwd</pre>
+
* Use the arrow keys to go to the line that start with '''linux'''
 
+
* Go the the end of that line (by pressing '''End''') add a space then the word '''single''' or the number '''1'''
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.
+
* Press '''Ctrl-x''' or '''F10''' to boot that entry
 
 
{{Anchor|bootloader-protected}}
 
== Reset Password When Boot Loader is Password Protected ==
 
 
 
<ol>
 
<li>Boot from the install or rescue CD/DVD.</li>
 
<li>Select "Rescue installed system."</li>
 
<li>Answer the prompts for language and keyboard.  Starting the network is optional and not needed.</li>
 
<li>Let the rescue mode mount your file systems in the read/write mode.</li>
 
<li>Hit ''Enter'' to get the shell prompt.</li>
 
<li>At the prompt, enter the following commands.  Do not enter any ''#'' mark or the text following it.  These comments are shown for explanatory purposes only.
 
<pre>chroot /mnt/sysimage  # Change to your disk file system
 
passwd                # Change the root password
 
exit                  # Exit the chroot environment
 
exit                  # Exit the rescue mode</pre></li>
 
</ol>
 
 
 
The system now unmounts the file systems and reboots.
 
 
 
== Reset Password When BIOS is Password Protected ==
 
  
If you cannot enter rescue mode because you forgot the BIOS password required to select an alternate boot device, you have three options:
+
{{admon/note | Encrypted partitions | Which ever GRUB version your system has, if you have an encrypted partition, you are prompted for the pass phrase before mounting the filesystems. If have more than one encrypted partition and they all share a global pass phrase, select the option for global pass phrase. Otherwise, enter the pass phrase separately for each partition.}}
* Refer to your computer's documentation for instructions on resetting the BIOS password in CMOS memory, usually by moving a physical jumper.
 
* Physically change the boot order.
 
* Temporarily move the system hard disk to another machine, and follow the procedures above to reset the root password.
 

Revision as of 09:08, 22 January 2014

Entering Rescue Mode

Using GRUB legacy

Note.png
GRUB legacy was the default boot loader up until Fedora 15.

While your system is starting up, hold down the Ctrl key or Esc to see the boot loader menu. 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 the number 1.
  • Press Enter to accept the changes.
  • Press b to boot this kernel.

A series of text messages scrolls by and after a short time, a root prompt appears awaiting your commands (#).

Using GRUB2

Note.png
GRUB2 has the default boot loader since Fedora 16.

While booting the system the GRUB2 menu will be displayed, to boot into the rescue mode follow these steps:

  • Use the arrow keys to select the boot entry you want to edit
  • Press e to start editing that entry
  • Use the arrow keys to go to the line that start with linux
  • Go the the end of that line (by pressing End) add a space then the word single or the number 1
  • Press Ctrl-x or F10 to boot that entry
Note.png
Encrypted partitions
Which ever GRUB version your system has, if you have an encrypted partition, you are prompted for the pass phrase before mounting the filesystems. If have more than one encrypted partition and they all share a global pass phrase, select the option for global pass phrase. Otherwise, enter the pass phrase separately for each partition.