Boot process and Service Control of CentOS 7 system (2)
six。 Fix grub menu
(1)。 Understand the location of the grup configuration file
1.cd / boot
two。 There are grub and grub2 in it.
Grub: background picture of startup menu
Grub2: startup menu profile
(2)。 Simulated destruction of the grub menu
(3) the following occurs when .reboot restarts
(4)。 Restart, press ESC during the reading phase and follow the steps to enter the first aid mode (connect the CD system image)
(5)。 Enter chroot / mnt/sysimage/ to enter the bash environment
(6)。 Enter grub2-install / dev/sda to reload the sda partition
(7)。 Enter grub2-mkconfig-o / boot/grub2/grub.cfg to rebuild the grub menu configuration file
(8)。 Enter exit to exit the bash environment and restart
(9)。 Wait for a while.
Grub menu repair completed
seven。 Crack the root password
When the root password is forgotten and cannot be operated by the administrator, you can enter the first aid mode to reset the password
(1) follow our previous method to enter the first aid mode (connect the CD system image)
(2)。 Enter chroot / mnt/sysimage/ to enter the bash environment
(3)。 Enter passwd root to change the password
(4)。 Enter exit to exit the bash environment and restart
(5)。 Log in to root with a new password
(6)。 Login succeeded
In this way, the root password of Centos 7 is cracked.