Merge #418 Reset-root-password.adoc

This commit is contained in:
Ankur Sinha 2022-01-28 09:59:04 +00:00
commit 9dda716592

View file

@ -3,8 +3,8 @@
include::{partialsdir}/unreviewed-message.adoc[]
Setting up a root password is one of the steps when installing Fedora.
If you forget, or lose, the root password, there are two common methods to reset it:
A root password may be set up while installing Fedora Linux, although it is now suggested to leave the root account locked and use `sudo`.
There are two common methods to reset the root password if it is forgotten or lost.
* In Rescue Mode
@ -18,23 +18,25 @@ If you forget, or lose, the root password, there are two common methods to reset
====
Changing passwords as root does not prompt for the old password.
Changing passwords as root will not prompt for the old password.
====
While booting the system the xref:bootloading-with-grub2.adoc[GRUB2] menu will be displayed.
To boot the system into rescue mode using `bash` follow these steps:
. Use the arrow keys to select the boot entry you want to edit
. Select the boot entry you wish to edit with the arrow keys.
. Press *e* to edit that entry
. Select the entry you with to edit by pressing *e*.
. Use the arrow keys to go to the line that starts with `linux`, `linux16`, or `linuxefi`
. Use the arrow keys to go to select the line begging with `linux`, `linux16`, or `linuxefi`.
. Go the the end of that line, add a space then type `rw init=/bin/bash`.
. Go the the end of that line and include a space and the following `rw init=/bin/bash`.
[Note]
====
If your disk is encrypted, you may need to add `plymouth.enable=0`
. Press *Ctrl-x* or *F10* to boot that entry
====
. Press *Ctrl-x* or *F10* to boot the entry
. Run the command:
+
@ -46,7 +48,7 @@ passwd
----
+
It will prompt you to enter the new root password twice.
You will be prompted to enter the new root password twice.
. Restore the SELinux context and permissions with:
+
@ -79,7 +81,7 @@ You may have to do a hard-reboot and start back at step 1.
----
The system may take a while to boot as SELinux will be relabeling its permissions on the filesystem.
The system may take a moment to boot while SELinux relabels its permissions on the filesystem.
If you see the Plymouth boot screen you can press the `ESC` key on your keyboard to view the SELinux progress.
Once it is complete, your system is ready and your root password has been successfully changed.
@ -94,11 +96,11 @@ To download and create a live USB of Fedora Workstation, follow the instructions
====
. Boot the Live installation media and choose `Try Fedora`
. Boot the Live installation media and choose `Try Fedora`.
. From the desktop, open a terminal and switch to root using `su` (it won't ask for a password)
. From the desktop, open a terminal and switch to root using `su` (the system will not ask for a password).
. To view your hard drive device nodes, in the terminal type: `df -H`.
. To view your hard drive device nodes, enter `df -H` into the terminal.
For this example we will use `/dev/sda1` for the `/boot` partition and `/dev/sda2` for the root `/` partition.
+
If you are using LVM partitions, type: `sudo lvscan` and note the `/dev` path of your root partition.