I'm looking to implement a way to optionally auto-decrypt a single drive system at boot. The flow would be like this:
I'm new to FreeBSD. I read geli(8) and was able to use setkey to add a key just fine. I then tried adding this to /boot/loader.conf
I was hoping that would skip the password, but I still get the password prompt. I'm not sure if it's even using that key. The docs are a little light with regards to what exactly that does (or I just don't know where to look for more info).
Is there a simple way to achieve this in the .conf files? If not, is it possible to use a shell script to implement the logic?
- Install FreeBSD, one disk, use GELI encryption
- Login, create a key: /root/quick-boot-with-no-password.key
- Create a reboot/shutdown script that offers two option: reboot with auto-decrypt, or not
- If auto-decrypt:
- copy /root/quick-boot-with-no-password.key to /boot
- reboot
- look for key, see that it is present, use it with no password, finish boot
- after boot, secure delete the key copy in /boot
- If no auto-decrypt
- no key copied to /boot
- reboot
- look for the key, see that it's not present and ask for a password, finish boot
- after boot, nothing to do
I'm new to FreeBSD. I read geli(8) and was able to use setkey to add a key just fine. I then tried adding this to /boot/loader.conf
Code:
geli_da0p4_keyfile1_load="YES"
geli_da0p4_keyfile1_type="da0p4:geli_keyfile1"
geli_da0p4_keyfile1_name="/boot/quick-boot-with-no-password.key"
I was hoping that would skip the password, but I still get the password prompt. I'm not sure if it's even using that key. The docs are a little light with regards to what exactly that does (or I just don't know where to look for more info).
Is there a simple way to achieve this in the .conf files? If not, is it possible to use a shell script to implement the logic?