When you using linux redhat or centos operating system and you forgot the user password, you can reset those user password through the root system. But How if you forgot the root password ? the only ways you can reset the root password through emergency mode. In this tutorial I’ll discuss to you about how to resetting the root password if you forgot them.
First, reboot the system and then interupt the boot loader with the press any key for stop countdown at boot loader. then press e for edit the entry.
Append rd.break on the end of line that start with linux as the following images bellow. after that press ctrl+x for exit system.
Give mount access as read/write on /sysroot and then switch to /sysroot access.
Setup the new password for root
do relabel for make sure all files that unlabeled will be relabeled during boot process.
Then, do exit command twice for exit the system and reboot them.
Then test login to root system with new password that are setup before.