How to reset Root user password from boot on Oracle Linux 8.5
To Reset Root Password From Boot On Oracle Linux 8.5
Introduction:
Grub is the boot menu. It allows you to choose between multiple operating systems if you have more than one installed. Additionally, Grub can be used for troubleshooting. It can be used to modify boot arguments or to boot from an older kernel. In this tutorial, I'll show you how to reset the root password in Oracle Linux 8.5.
Procedure:
Step 1: Restart the linux machine by using the below command
[root@localhost linux]# init 6
Step 2: 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 3: From the grub options, go to the line that starts with “ linux” as shown in the below image
Step 4: you have to go the end of the line and type “ rd.break” and then press ctrl+x as shown in the below image
Step 5: Now the initrampfs prompt with a 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 -o remount,rw /sysroot” as shown in the below image
Step 6: 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”
From here the root password can be reset with “ passwd” command as shown in the below image
Step 7: Now we can reboot but, as centos 7 uses 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 8: Now Select Not listed and Enter username as root and Enter the 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 oracle linux 8.5 on Oracle Linux 8.5. Your feedback is much welcome.
Comments ( 0 )
No comments available