
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 916 Views
Recovery root password
Hi, i am trying to reset root password follwed this guide: https://docs.fedoraproject.org/en-US...root-password/ , on fedora VM (relase 41) for rescue mode the points mentioned in the guide are as follows:
- Select the boot entry you wish to edit with the arrow keys.
- Select the entry you wish to edit by pressing e .
- Use the arrow keys to go to select the line beginning with linux , linux16 , or linuxefi .
- Go the the end of that line and include a space and the following rw init=/bin/bash .
- Press Ctrl-x or F10 to boot the entry
- Run the command: passwd, You will be prompted to enter the new root password twice.
- Restore the SELinux context and permissions with: touch /.autorelabel
- Reboot the machine with: /sbin/reboot -f
i tried to do this points but its don’t work because after execute the VM reboot and i try to login with the root user, say to me password login incorrect. I specify that i follwed the guide step by step. Can someone help me figure out how to reset/recover the root password using the procedure from the bootloader menu? (I urgently need for the Red Hat RHCSA exam).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 901 Views
Hi @samueleaudace ,
There might be something wrong with the link you posted, but let me try to help you with these steps to reset the root password anyway
Append the following directive to the kernel line (at the end of the 'linux' line), then ctrl+x or f1
rd.break
Once in the emergency shell you'll need read and write access to modify the root password
mount -o remount,rw /sysroot
chroot /sysroot
Now change the password:
passwd
To ensure SELinux context is correctly applied to the new password, touch the autorelabel file:
touch /.autorelabel
Exit now
exit
exit
Let me know if you run into any issues
regards,
Keep fighting, peacefully!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 893 Views
Regarding your method using 'rw init=/bin/bash,' I suspect the issue might be with the use of '/sbin/reboot -f.' This command forces a reboot without gracefully shutting down services or properly unmounting file systems. In contrast, using 'exit' allows the system to proceed with normal boot or shutdown processes, including reinitializing SELinux contexts if /.autorelabel was touched. Just my two cents.
Keep fighting, peacefully!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 856 Views
did you try to nullify root password...after nully root password in /etc/passwd file in maintainace mode ...we should able to login servers without root password then you set root password.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 682 Views
There is no need to reboot the system forcefully, all your steps are correct just change the last one with exec /sbin/init instead to start the initialization process.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 128 Views
Hello,
Here is the Redhat Documentation for recovering root password:
https://www.redhat.com/en/blog/recover-root-passwd
Regards
Gopinath