Hi there recently I started learning Linux
Normally resetting the root password is a simple task if you’re logged in already with root privileges, however, if you forget the password and need to change it things become a little more difficult.
This procedure will be completed in the console of the Linux system, so be sure that you have access to this prior to the beginning. As with all system maintenance tasks, be sure you have a system backup/snapshot prior to proceeding.
I am using RHEL 7 Oracle in virtual box
So here are the steps you have to do for cracking Linux root password
1. At the boot menu, press the ‘e’ key to edit the first boot entry.
2. Find the line that starts with “linux16” and go to the end of it. Enter ‘rd.break’ without quotes at the end of this line
3.Press ctrl+x
4.And then type “mount -oremount,rw /sysroot/ then enter
5.Now type “chroot /sysroot”
6. Then type “passwd root”.
7. Enter the new password.
8. Confirm the password.
9. Now make a new file by “touch /.autorelabel”
10.Type “exit” and enter
11. Type again “exit” and enter.
System will reboot.
Here is a tutorial of it.