Grub2 passwords
GRUB 2 is a bit of a pain to configure, to put it mildly...
Here's how to set a password for a Windows menu option on a dual-boot system (tested on Debian with grub-pc 1.99-11):
Generate a password hash with
grub-mkpasswd-pbkdf2
.Create a new file
/etc/grub.d/01_auth
with the following contents (replace hash inpassword_pbkdf2
with your own from step 1):
#!/bin/sh
cat <<EOF
set superusers="admin"
password_pbkdf2 admin grub.pbkdf2.sha512.10000.C97A...blah...0B6
EOF
Set the executable permission on this file with
chmod +x
.Edit
/etc/grub.d/30_os-prober
and replace
menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os {
with
menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os --users admin {
- Run
update-grub
and reboot to test. You should now be prompted for credentials when you select the Windows menu item.