Ubuntu – Password protect GRUB menu

We can achieve this by editing the 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

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s