0
0

I did the following:

edited /etc/grub.d/00_header

added at the end

set superusers=”tux”
password tux grub.pbkdf2.sha512.10000. (the rest of the salt)

After rebooting it does not ask for my password.

I also tried doing it without encryption at first.

  • You must to post comments
0
0

Setup boot password protection for GRUB2 entries:

Step1:
Add the following the bottom of /etc/grub.d/00_header

cat << EOF
set superusers="myname"
password myname 1234
EOF

here “myname” and “1234″ after “password” are the username and password you need to type to access grub entries.

Step2:
Change the following in /etc/grub.d/10_linux to password protect Linux installations on the main partition:
from:

menuentry "$1" {

to:

menuentry "$1" --users myname {

Note:This is what I change in my 64-bit machine:

 printf "menuentry \"${title}\" --class linux --users myname {\n" "${os}" "${version}"

Step3:
Change the following in /etc/grub.d/20_memtest to password protect the memtest86+ option:
from:

menuentry "Memory test (memtest86+)" {

to:

menuentry "Memory test (memtest86+)" --users myname {

Additional memtest86+ entries (from other partitions) may also be located in this file. The line will start with “menuentry”. Change these lines as desired.
Step4:
Change the following in /etc/grub.d/30_osprober to password protect kernels/operating systems on other partitions.Look for any line in /etc/grub.d/30_osprober which begins with “menuentry”.

menuentry "${LONGNAME} (on ${DEVICE})" {
menuentry "${LLABEL} (on ${DEVICE})" {

Make the change as described in previous step.
Step5:
Finally,requiring a password for every menuentry in a file can be added using the following command:

sudo sed -i -e '/^menuentry /s/ {/ --users myname {/' /etc/grub.d/10_linux  /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober /etc/grub.d/40_custom

To undo this command:

sudo sed -i -e '/^menuentry /s/ --users myname {/ {/' /etc/grub.d/10_linux  /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober /etc/grub.d/40_custom

Save the files, run sudo update-grub, and reboot. At the Grub 2 menu, you will be presented with the normal menu. When you make a selection, a prompt will ask for the username and password.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.