Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
Created November 21, 2010 00:08
Show Gist options
  • Save tskrynnyk/708298 to your computer and use it in GitHub Desktop.
Save tskrynnyk/708298 to your computer and use it in GitHub Desktop.
Grub2 passwd protection
. '/etc/grub.d/00_header':
----
cat << EOF
set superusers="user1"
password user1 password1
EOF
----
. '/etc/grub.d/10_linux':
----
printf "menuentry --users user1 '${title}' ${CLASS} {\n" "${os}" "${version}" {
----
. Password Encryption
~~~~
# grub-mkpasswd-pbkdf2
Enter password:
Reenter password:
Your PBKDF2 is grub.pbkdf2.sha512.10000.27E7570538711F871060082CBD21E0B06F46406465E07E49B4959746BA80C522E1E8C6941D7BE109846A01ADD52148EAC4B358A43916BCC2456EE2FBC47DEAF1.1CB35090D35B44AB599FD0EEAF53F84C5F95BFC9741BFFE9609348DD50174B9E865C9565F014EA8DBD94DCC6CD5C9CEEE1592267D32D4D647A9DCE20B94187BF
~~~~
----
cat << EOF
set superusers="user1"
password_pbkdf2 user1 grub.pbkdf2.sha512.10000.27E7570538711F871060082CBD21E0B06F46406465E07E49B4959746BA80C522E1E8C6941D7BE109846A01ADD52148EAC4B358A43916BCC2456EE2FBC47DEAF1.1CB35090D35B44AB599FD0EEAF53F84C5F95BFC9741BFFE9609348DD50174B9E865C9565F014EA8DBD94DCC6CD5C9CEEE1592267D32D4D647A9DCE20B94187BF
EOF
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment