Redhat7 system root user password cracking

I believe everyone has used the Linux system, so everyone is familiar with Redhat7. Everyone knows that when creating a Redhat7 virtual machine, you need to configure the password of the root user. Then the problem arises. Sometimes you forget the root password. What should I do? Next, I will share with you a small method to crack the password.

1. Restart the virtual machine, press the space bar when entering the GRUB interface, which is the following interface

 2. After the operation, see the bottom of the interface, press "E" to enter the edit mode, enter the edit mode and find the line of linux16

3. Move the cursor to the front of the linux16 line, press the "END" key to jump to the end, delete the characters from rhgb to the end at the end, delete the input space and rd.break

 4. After the input is complete, press and hold Ctrl+X to enter a "fake system"

 5. Perform the following operations

mount -o remount,rw /sysroot

chroot /sysroot/

passwd

touch /.autorelabel

 6. After the operation is completed, enter exit twice to exit, and the system will automatically restart

 7. Enter the system normally, and log in with the modified root password.

Guess you like

Origin blog.csdn.net/qq_53086187/article/details/125549859