Why do we do this? we all know that the procedure is as follows: leekwen @ leekwen :~ Grub-mkpasswd-pbkdf
Why do we do this? the packages all know how to directly perform the following operations:
Leekwen @ leekwen :~ # Grub-mkpasswd-pbkdf2Enter password:
<这里输入你的grub密码reenter password: <<<这里输入你的grub密码your pbkdf2 is grub.pbkdf2.sha512.10000.bc4d0a450e86ee447561fc822c832xxxxxxxxxxxxx45572d3b4e40500celeekwen@leekwen:~# cp etc grub.d 00_header 00_header.bakleekwen@leekwen:~# vi 00_headerleekwen@leekwen:~# tail -n 6 00_header### add those line to set grub2 password cat <
In this way, after the restart, when you press e for the startup item, you will be asked to enter:
username:password:
Only after the user name (for example, the user name I just set is: leekwen) and the password is correct (the password just generated with the grub-mkpasswd-pbkdf2) can enter the Edit menu of the startup item, this step is safe. remember to run the "update-grub" command after modifying the 00_header so that it will take effect !!!