How to reset Root user password from boot on Rocky Linux 8.6
To Reset Root Password From Boot On Rocky Linux 8.6
Introduction:
Users can only change their own passwords. However, there is still a sudo/root (SuperUser) account. Root users can change the password of any account, even their own. By default, the root user is locked.
Procedure:
Step 1: While turning on the power button, at the grub boot menu press the “ e” key to edit the first boot entry as shown in the below image
Step 2: From the grub options, go to the line that starts with “ linux” go the end of the line and type “ rd.break” and then press ctrl+x as shown in the below image
Step 3: Root shell will appear at this stage, the root file system is mounted in read only mode to /sysroot and it must be remounted with read/write (rw) permission, so enter “ mount &ndash o remount,rw /sysroot as shown in the below image
Step 4: once the file system is remounted, change it to chroot jail so that /sysroot is used as the root of the file system.this can be done by running “ chroot /sysroot” as shown in the below image
Step 5: From here the root password can be reset with “ passwd” command as shown in the below image.
Step 6: Now we can reboot but, SELINUX enforcing mode by default we have to fix the context of the /etc/shadow file so create “ touch /.autorelabel” as shown in the below image
Step 7: Creating this file automatically perform a relabel of all files on next boot.Type “exit” twice and machine will reboot, once the reboot is complete the root account will set with a newly set password as shown in the below image.
Step 8: Now the machine will reboot and the login screen appears as shown in the below image
Step 9: login using a root user with changed password as shown in the below image
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to reset root password from boot on Rocky Linux 8.6. Your feedback is much welcome.
Comments ( 0 )
No comments available