1

Is there a way I can password protect grub menu entry- e.g. if I dual boot with Windows 7 can I set it so that a password is needed to boot into Win 7?

Secondly I would also like to protect grub menu entries being changed if possible.

thanks

1 Answer 1

1

There is a Wiki page on Ubuntu covering all type of password related topics.

Basically, edit your configuration

gksu gedit /etc/grub.d/00_header /etc/grub.d/30_os-prober

Add this at the bottom of 00_header:

cat << EOF
set superusers="user1" 
password user1 password1
EOF

That way the edits will be password protected, with that user and password.

Now, let's protect the Windows entry. Open 30_os-prober and find this line:

menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \

On that line, add --users, so it ends like this:

menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os --users \

Be careful on not removing the ending slash \.

Save and close, and then run this on a terminal:

sudo update-grub

You can also encrypt your password with grub-mkpasswd-pbkdf2. Please take a look at the wiki for more details.

2
  • I have the line menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os { in that file, is this the same? I can't see any other mention of windows in the 30_os-prober file.
    – fpghost
    Jan 28, 2013 at 20:20
  • Yes, I'm on 12.10, so that's the reason of the difference. Jan 28, 2013 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .