How to easily add password protection to GRUB

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
l0wt3ch
Posts: 182
Joined: Thu 24 Apr 2014, 01:30

How to easily add password protection to GRUB

#1 Post 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

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#2 Post 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?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#3 Post 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

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#4 Post by mikeb »

Actually I noticed in grub4dos help list there is password --md5 so perhaps encryption is possible after all :)

mike

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#5 Post 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:

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#6 Post 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

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#7 Post 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.

Post Reply