Topic: Password Protect Grub2
I was recently pondering how to add password protection to your Grub2 menu entries on the old Legacy Grub this was done with the command grub-md5.
However grub2 uses a newer method, so I'll outline the brief how to here if anyone is interested in password protecting there grub2 with SHA-512 (an NSA algorithm no less)
First you'll need to type the command:
grub-mkpasswd-pbkdf2Now type in your chosen password...
Then open up the terminal and type sudo -i to login as root then type: gedit /etc/grub.d/00_header
Now you want to take your new password which will look something like the following:
grub.pbkdf2.sha512.10000.5F60AA485BA2B7EA640974BCDF5722F7600FDAF99AFE6AD8ECA33A1A05E53AB85B8B426E22AC246CC50558807BBA24752CBD61FD04155E26C41307F4AD64C9F7.0BDA015BBD97F09776CB66C90E0D82C2855C297039A1638D28A77FE2DDA3C8B8105C82FB2766FAEF4400647917A82CF3FB4B8E9B43ACBA6439F1E3C9B1A90194And use the following code example of how to paste it in at the end of the 00_header file under the last line of code so it will look like this:
cat << EOF
set superusers="putyourusernamehere"
password putyourusernamehere grub.pbkdf2.sha512.10000.5F60AA485BA2B7EA640974BCDF5722F7600FDAF99AFE6AD8ECA33A1A05E53AB85B8B426E22AC246CC50558807BBA24752CBD61FD04155E26C41307F4AD64C9F7.0BDA015BBD97F09776CB66C90E0D82C2855C297039A1638D28A77FE2DDA3C8B8105C82FB2766FAEF4400647917A82CF3FB4B8E9B43ACBA6439F1E3C9B1A90194
EOF Now do the command update-grub and your new password policy will be enforced and no one but you will know the password to edit your grub2 config.
Obviously please use your own user name and passwords, not putyourusernamehere and the password provided above as this is only an example.
The code you need at the end of the file is:
cat << EOF
set superusers="username"
password username <that goes here and dont forget the space>
EOFLast edited by db_crunch (2011-05-06 19:31:06)