Page 1 of 1

How to easily add password protection to GRUB

Posted: Wed 22 Apr 2015, 16:42
by l0wt3ch
Based on Karl Godt's thread here: http://www.murga-linux.com/puppy/viewto ... b37cfe516f

Wanna add password protection to your full install without installing a login manager? It's easy!

This tutorial assumes you already have grub installed.

Go to /boot/grub and rename menu.lst to menu-main.lst

Create a new menu.lst in the same folder (the "l" in "lst" is a lower-case L). Copy in this text:

Code: Select all

hiddenmenu
timeout 0

default 0
fallback 1 2 3

title "Enter password"
 password yourpassword
 configfile (hd0,5)/boot/grub/menu-main.lst

title "Enter password"
 password yourpassword
 configfile (hd0,5)/boot/grub/menu-main.lst

title "Enter password"
 password yourpassword
 configfile (hd0,5)/boot/grub/menu-main.lst

title "Three times password failed"
 halt 
Change "yourpassword" to whatever you want your password to be. Also change "hd0,5" to whatever partition you have Puppy installed. Remember that grub starts counting at 0, so if your installation is on sda3, it has to say "hd0,2".

That's it! :D

Posted: Fri 24 Apr 2015, 04:24
by s243a
Being able to encrypt the drive is one thing but can we also somehow integrate this with a BIOS password so that other systems can't write to the drive without the password?

Posted: Fri 24 Apr 2015, 09:43
by mikeb
cute.... even without the encrypted password its probably enough for most users.
Now if there were subsequent menus with a choice of save file/folder (can puppy do this?) then you could have login and user profiles all from grub.

Quite a nice sideways approach to the need..especially if a full colour boot menu is used.

Slim is a neat login manager if you ever get the urge.

Just to confirm this works perfectly with grub4dos and a frugal setup... not sure if legacy grub with a full install was being referenced.

mike

bummer...no graphical menu this way :( ...oh well can't have everything

Posted: Sat 25 Apr 2015, 19:01
by mikeb
Actually I noticed in grub4dos help list there is password --md5 so perhaps encryption is possible after all :)

mike

Posted: Tue 23 Jun 2015, 21:29
by Mike Walsh
Hi, l0wt3ch.

Just out of curiosity, how could you make this work for a set-up, like mine, where there are multiple Pups.....all booted from Grub4DOS?

I run Tahrpup, Slacko 570, ETP's 'ChromeBook' Pup (v.2), and Precise 571. Oh,and just to add a little bit of spice to the mix, I also have SliTaz 4.0 on a small partition.....also booted from Grub4DOS (with a couple of small modifications to its Grub menu entry).

I assume that your solution here references a single-Puppy install?


Regards,

Mike. :wink:

Posted: Wed 24 Jun 2015, 12:34
by cimarron
These instructions seem to be for GRUB, not Grub4dos. But it looks like it is possible to add passwords (even encrypted) to Grub4dos boot entries:

Grub4dos Guide: Password Protecting Boot Options

Posted: Wed 24 Jun 2015, 12:58
by Mike Walsh
Thanks for that, Cimarron. I've had a look at the link, and it seems to be just what I'm looking for.

Cheers! :)


Regards,

Mike.