If it is forbidden to enter a single user, first configure the password of grub, and only modify /boot/grub/grub Conf or /etc/grub Conf (/etc/grub.conf is a symbolic link to /boot/grub/grub.conf).
For example: VI /boot/grub/grub Conf enter the configuration file for editing In the next line of the splash image parameter, you can add password= password. After saving, restart the computer. When you log in to the grub menu page again, you will find that you can no longer directly use the e command to edit the startup tag. You must first use the P command and enter the correct password before you can edit the startup tag. However, weset upThe clear text password is not very secure.
If others get the plaintext password, they can still modify the grub startup tag to change the root password.
So we need to use MD5 to encrypt it. Enter grub-md5-crypt in the terminal and press entersystemYou will be asked to enter the same password twice, and thensystemMD5 code will be output. You only need to copy the generated MD5 ciphertext, and then follow the format of password –md5 MD5 ciphertextset upGlobal or menu password, save, exit and restart the computer.