rss.png profile for ebal on Stack Exchange, a network of free, community-driven Q&A sites
Sep
13
2010
How to add password on your grub menu

Security is like an onion, it has many many layers.
(and sometimes we end up crying)

For preventing someone to boot your linux (or not) partition it is best to protect your grub menu.

There are two ways:

1st : To use a global password for grub
2nd: To use different passwords for every menu title.

I prefer the second method cause is a more security solution.

We need to create the encrypted password, from our terminal we type:


$ grub-md5-crypt
Password: 
Retype password: 

$1$nNyIl/$2rdkv9UCclYQu1Hb0hxiQ/

For our example i typed: test

And finally we add the bellow line in /boot/grub/menu.lst


password --md5 $1$nNyIl/$2rdkv9UCclYQu1Hb0hxiQ/

eg.

title Arch Linux [vmlinuz26]
root (hd0,0)
kernel /boot/vmlinuz26 root=/dev/sda1 ro
initrd /boot/kernel26.img
password –md5 $1$nNyIl/$2rdkv9UCclYQu1Hb0hxiQ/