The use of passwords is one of the precautionary and security measures most used by millions of people in the world and these range from access to emails to access to users. In Linux environments there is a delicate password that we must take into account for many reasons and it is the password of the root user (superuser) since this user is the one who has all the permissions to execute all the actions in the system..
It is ideal for hundreds of administrative or support tasks. To access with this user, it will be necessary to enter the password of said user that we created during the installation process of, in this case, Fedora, so if we have forgotten it, not everything is lost since TechnoWikis will explain how to set this password again in a simple and fully functional way.
1. How to reset root password in Fedora
Step 1
For this case we will use Fedora 31 which is available at the following link:
Fedora
To reset the password we must start Fedora and at boot time we will see the following:
Step 2
We select the line with the Fedora version and enter the letter "e" to access the GRUB editor we will see the following:
Step 3
There we go to the line that begins with "Linux" and at the end of this we will see the text "rhgb quiet":
Step 4
We replace this text “rhgb quiet” with the text “rd.break enforcing = 0”:
Step 5
Now we use the Ctrl + X keys to access the simple user mode which has the following appearance:
In the console we will execute the following line:
mount –o remount, rw / sysroot
Step 6
This command will re-mount the root file system in read and write mode:
Step 7
We now grant access to the Fedora system by running:
chroot / sysroot
We execute the command "passwd" to assign and confirm the new password:
We can see the informational message that the authentication tokens have been updated, we reboot the system with the Ctrl + Alt + Del keys..
Ctrl + Alt + Del
Step 8
When we access Fedora again, we go to the terminal and there we will execute the following in order to update the SELinux tag:
restorecon -v / etc / shadow
Then we force the way of using SElinux:
setenforce 1
With this we have established the root password in Fedora and we will have access to the system again.