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:
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).
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,
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.
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.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.