2017-10-26 21:20:01 +00:00
|
|
|
= How to reset a root password
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
2017-10-27 20:44:00 +00:00
|
|
|
[IMPORTANT]
|
2017-10-26 21:20:01 +00:00
|
|
|
======
|
|
|
|
|
|
|
|
This page was automatically converted from https://fedoraproject.org/wiki/How_to_reset_a_root_password
|
|
|
|
|
|
|
|
It is probably
|
|
|
|
|
|
|
|
* Badly formatted
|
2017-11-06 17:34:22 +00:00
|
|
|
* Missing graphics and tables that do not convert well from mediawiki
|
2017-10-26 21:20:01 +00:00
|
|
|
* Out-of-date
|
|
|
|
* In need of other love
|
|
|
|
|
|
|
|
|
2017-11-10 15:16:19 +00:00
|
|
|
Pull requests accepted at https://pagure.io/fedora-docs/quick-docs
|
2017-10-26 21:20:01 +00:00
|
|
|
|
2018-01-26 18:29:28 +00:00
|
|
|
Once you've fixed this page, remove this notice, and update
|
|
|
|
`_topic_map.yml`.
|
|
|
|
|
|
|
|
Once the document is live, go to the original wiki page and replace its text
|
|
|
|
with the following macro:
|
2017-10-26 21:20:01 +00:00
|
|
|
|
|
|
|
....
|
2018-01-26 18:29:28 +00:00
|
|
|
{{#fedoradocs: https://docs.fedoraproject.org/whatever-the-of-this-new-page}}
|
2017-10-26 21:20:01 +00:00
|
|
|
....
|
|
|
|
|
|
|
|
======
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
link:#using-installation-cd-dvd[ this section].
|
|
|
|
* If you want to reset the boot loader password, refer to
|
|
|
|
link:Reset_Bootloader_Password[ these instructions].
|
|
|
|
* If none of these scenarios apply to you, proceed to
|
|
|
|
link:#Entering_Rescue_Mode[ the next section].
|
|
|
|
|
|
|
|
Fedora uses _targets_ 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-grub2]]
|
|
|
|
Using GRUB2
|
|
|
|
^^^^^^^^^^^
|
|
|
|
|
|
|
|
While booting the system the GRUB2 menu will be displayed, to boot the
|
|
|
|
system using bash 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 starts with *linux* or
|
|
|
|
*linux16*
|
|
|
|
** If you have a UEFI system it's the line that starts with *linuxefi*
|
|
|
|
* Go the the end of that line add a space then *rw* then another space
|
|
|
|
and *init=/bin/bash*
|
|
|
|
** If your disk is encrypted, you may need to add *plymouth.enable=0* as
|
|
|
|
well
|
|
|
|
* Press *Ctrl-x* or *F10* to boot that entry
|
|
|
|
|
|
|
|
[[changing-root-password]]
|
|
|
|
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.
|
|
|
|
|
|
|
|
To make sure that selinux context of file which were now modified is
|
|
|
|
restored properly after reboot, run:
|
|
|
|
|
|
|
|
....
|
|
|
|
# touch /.autorelabel
|
|
|
|
....
|
|
|
|
|
|
|
|
You can than reboot the machine with
|
|
|
|
|
|
|
|
....
|
|
|
|
# /sbin/reboot -f
|
|
|
|
....
|
|
|
|
|
|
|
|
[[reset-password-using-a-fedora-cddvd]]
|
|
|
|
Reset Password Using a Fedora CD/DVD
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
[[using-any-of-the-fedora-live-media]]
|
|
|
|
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:
|
|
|
|
|
|
|
|
`passwd`
|
|
|
|
|
|
|
|
* Exit from the chroot:
|
|
|
|
|
|
|
|
`exit`
|
|
|
|
|
|
|
|
That's it, simply reboot your system and then boot the installation from
|
|
|
|
the HDD as usual.
|
|
|
|
|
|
|
|
[[reset-password-when-bios-is-password-protected]]
|
|
|
|
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:
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
Category:How_to
|
|
|
|
'''
|
|
|
|
|
|
|
|
See a typo, something missing or out of date, or anything else which can be
|
2017-11-10 15:16:19 +00:00
|
|
|
improved? Edit this document at https://pagure.io/fedora-docs/quick-docs.
|