The steps to modify the password are as follows:
- Load the CD, select in the CD boot interface ----- troubleshooting
- Enter the troubleshooting menu and select -----Rescue a centos system
- To enter the guide, you can press enter, or wait to press 1 and press enter to enter sh-4.2#
- Cut the root after entering rescue mode:
chroot /mnt/sysimage/
- change Password:
passwd root
输入密码:123123 ## 1次
输入密码:123123 ## 2次
- Restart:
exit
reboot
- verification:
- Login: root
- Password: 123123
Just complete a simple password change operation
Repair CD files
- Load the CD, select in the CD boot interface-----troubleshooting
- Enter the troubleshooting menu, select ----- Rescue a centos system
- To enter the guide, you can press enter, or wait to press 1 and press enter to enter sh-4.2#
- Cut the root after entering rescue mode:
chroot /mnt/sysimage/
- Use the grub2-install command to repair grub-----------------------------###It is not good to use the 7 and 8 commands
grub2-install /dev/sda
- Check if it is repaired:
cd /boot/grub2/
- Use the grub.cfg configuration file:
grub2-mkconfig -o /boot/grub2/grub.cfg
- Check if it is repaired:
cd /boot/grub2/
- Restart:
exit
reboot
Finish changing the hard disk to the priority startup item