Created
April 16, 2019 06:51
-
-
Save AfroThundr3007730/fc43be4a56cfe03eaabf95ee03dba613 to your computer and use it in GitHub Desktop.
Password protect GRUB configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
cat << EOF | |
if [ -f \${prefix}/user.cfg ]; then | |
source \${prefix}/user.cfg | |
if [ -n "\${GRUB2_PASSWORD}" ]; then | |
set superusers="root" | |
export superusers | |
password_pbkdf2 root \${GRUB2_PASSWORD} | |
fi | |
fi | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRUB2_PASSWORD=grub.pbkdf2.sha512.10000.DEADBEEF... # replace with output of `grub-mkpasswd-pbkdf2` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
01_users
to/etc/grub.d/
and make executable.user.cfg
in the grub boot directory (next togrub.cfg
).--unrestricted
to theCLASS
variable in/etc/grub.d/10_linux
.grub-mkconfig -o /path/to/grub.cfg
to update grub.