The first step, boot the system and press any key to interrupt the normal boot process, then you will see the screen shown below. Here, select GRUB option (in the following snapshot highlighted in blue), then press the "e" to edit
the second step, change the kernel
in here to go to end of the line, and then write the word UTF-8 behind rd. break console = tty0 (highlighted in blue in the following snapshot), and then press Ctrl + x to continue processing. Follow these snapshots.
After pressing Ctrl + x, enters the console, as shown in the following snapshot.
The third step is the authorization / sysroot write permissions
here, we need to use the rw (read / write) permission to mount / sysroot to reset the root passwd, because by default / sysroot in ro (read only) permissions model
that we can use mount command check, the following snapshot.
So let us use the following command rw (read / write) permission to mount / sysroot
As we can see in the following snapshot now / sysroot have rw (read / write) permissions
Now, type the command chroot here / sysroot / directories as root and redirect you to the shell prompt shown below.
sh-4.2#
The fourth step, reset the root password
so now we have a Shell Prompt. Here, we can use the passwd command to reset the root password linux, as shown in the following snapshot
As we have seen in the snapshot as, root password has been updated successfully run the following command to automatically SElinux relabel the file system.
Then run the exit command to exit from the Shell Prompt, and then run the reboot command to reboot the system