The previous post was a tutorial on how to enable or password protect the GRUB. But I think it is not complete. The passwords will be stored as plain
text if you perform the changes given in the previous post. In order to encrypt those passwords you must generate an encrypted version for each. For
this we use grub-mkpasswd-pbkdf2
1. Open the terminal
2. Run the following command
grub-mkpasswd-pbkdf2
3. Enter the desired password and reenter it when prompted.
4. Copy the resulting code
5. The format for an encrypted password entry in /etc/grub.d/00_header would look similar to the following
set superusers=”root”
password_pbkdf2 root <paste_the_code_starting_with grub.pbkdf2.sha512.>
Note:- You must replace the line password root 123456 with the bove line if you had one(as it is clear).
6. Save the file and run sudo update-grub