+3 votes
429 views
Forgot password root Fedora | Recover and reset

in Linux / Unix by (552k points)
reopened | 429 views

1 Answer

+4 votes
Best answer

1. How to reset root password in Fedora

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:

 

image

 

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:

 

image

 

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":

 

image

 

Step 4

We replace this text “rhgb quiet” with the text “rd.break enforcing = 0”:

 

image

 

Step 5

Now we use the Ctrl + X keys to access the simple user mode which has the following appearance:

 

image

 

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:

 

 

 

image

 

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:

 

 

 

image

 

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 
image

 

With this we have established the root password in Fedora and we will have access to the system again.

 


by (3.5m points)

Related questions

+3 votes
1 answer
asked Apr 28, 2020 in Linux / Unix by backtothefuture (552k points) | 249 views
+5 votes
1 answer
asked Apr 2, 2020 in Linux / Unix by backtothefuture (552k points) | 248 views
+3 votes
1 answer
asked Oct 5, 2019 in Windows 10 by backtothefuture (552k points) | 255 views
+5 votes
1 answer
asked Nov 23, 2022 in WindowsServer by backtothefuture (552k points) | 44 views
+4 votes
1 answer
asked Nov 16, 2021 in Guides by backtothefuture (552k points) | 108 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,653 questions
10,785 answers
510 comments
3 users