Modify how_to_config_grub2_password_protection.mkd

This commit is contained in:
samson 2018-12-12 04:55:57 +08:00
parent 1ed60be217
commit a827cee119

View File

@ -34,13 +34,13 @@ To alter the /etc/grub.d/30_os-prober to add password protection to all entries:
# sed 's/--class os /--class os --users /' -i /etc/grub.d/30_os-prober # sed 's/--class os /--class os --users /' -i /etc/grub.d/30_os-prober
``` ```
### 3Add password protection to /etc/grub.d/40_header ### 3Add password protection to /etc/grub.d/40_custom
``` ```
set superusers="username" set superusers="username"
password_pbkdf2 username password password_pbkdf2 username password
``` ```
Obviously you should replace the words "username" with your desired user name, and the word password for the encrypted password generated in the previous step. Obviously you should replace the words "username" with your desired user name, and the word password for the encrypted password generated in the previous step.
The format for an encrypted password entry in /etc/grub.d/40_header would look similar to the following (shortened in the example): The format for an encrypted password entry in /etc/grub.d/40_custom would look similar to the following (shortened in the example):
``` ```
set superusers="John" set superusers="John"
password_pbkdf2 John grub.pbkdf2.sha512.10000.F5CFD948DC06B644E05531FBF9773C086B228A87033642B32D41DBE141B10D2FD0604C8ABCDD2D2D76C834297969EADC64687EB32662CB59BCA0898AD69D7FE6.C698997624F217CDCE83446E80632FF9F7AFB1A0A6AE0B5752A81392F1BAA9A44C37AF5B29D7CEE13B9DE7D1207D5FB4A173A49D1518B1492BB6D9FE45444656 password_pbkdf2 John grub.pbkdf2.sha512.10000.F5CFD948DC06B644E05531FBF9773C086B228A87033642B32D41DBE141B10D2FD0604C8ABCDD2D2D76C834297969EADC64687EB32662CB59BCA0898AD69D7FE6.C698997624F217CDCE83446E80632FF9F7AFB1A0A6AE0B5752A81392F1BAA9A44C37AF5B29D7CEE13B9DE7D1207D5FB4A173A49D1518B1492BB6D9FE45444656