LUKS decrypt at boot over SSH?


in reply to clif

If you run a system that uses dracut to manage its initramfs, then github.com/gsauthof/dracut-ssh… might be of use to you.

I have it setup on a server running Fedora and can’t complain. When the system reboots and plymouth shows the LUKS password prompt a ssh server is started in the background as well - so I can unlock the server either using keyboard or connect via SSH.
When rebuilding the initramfs (eg. for a new kernel version) the ssh server is installed and setup automatically so I don’t really have to worry about anything after the initial setup.

in reply to clif

in reply to just_another_person

If I'm reading the docs correctly, Clevis can rely on a separate Tang server for retrieving the decryption key, right? So in that scenario I'd need to have another machine for Tang that can also auto-boot without entering a boot/LUKS password. Otherwise, if both machines (server+clevis and Tang server) were in the same room and restarted due to power loss, neither would be able to boot if both were encrypted... or did I misunderstand something important?

And I don't think I actually want "automatic" unlocking. I just want to be perform the unlock (enter LUKS password) remotely. I realize that comes with manual intervention (entering the password remotely) but I'm okay with that. I should probably have clarified that by "home server" I mean a machine the serves nice to have stuff, nothing mission critical. Plus I'm really the only one who uses it currently so I'll notice it's down when something doesn't work and can then initiate the remote unlock/boot : D

Clevis is interesting but I don't think it matches my specific situation. Glad I know about it now though, thanks for the info.

in reply to clif

Same boat. I'm currently testing some unlock stuff out. I just got USB unlocks to work for Debian by following this: tqdev.com/2022-luks-with-usb-u…

I load a USB with a keyfile, then read the keyfile during boot. If I don't have the USB plugged in, I fallback to entering a passphrase. I have multiple LUKS encrypted disks and I don't want to type out a long passphrase a bunch of times.

I briefly encountered dropbear during my research... but ended up following the USB path because it kinda seemed a little easier to setup. 🤷

Anyone have any thoughts on USB vs dropbear unlocks?

This entry was edited (6 months ago)
in reply to paequ2

in reply to SirMaple__

This is interesting, another one I hadn't heard of yet. And, the server is running Debian : )

I enjoy the intro too :

You know how it is. You’ve heard of it happening. The Man comes and takes away your servers, your friends’ servers, the servers of everybody in the same hosting facility. The servers of their neighbors, and their neighbors’ friends. The servers of people who owe them money. And like that, they’re gone. And you doubt you’ll ever see them again.
That is why your servers have encrypted root file systems
in reply to PoisonedPrisonPanda

In addition to drives being safer to replace and sell, encryption at rest should also protect against theft. So the scenario being someone taking the server or its drives.
At least for me encrypting the drives gives a bit more peace of mind seeing as credentials for various accounts aren’t easily retrieved from the disks.

But yeah, this does not protect from data being read at runtime

in reply to clif

Yes it's not too much bother to set this up, it can be put into ansible and once working I've not had to touch it again. Here's another dracut tool using dropbear that works well and has decent instructions on setup: dracut-crypt-ssh

The crypt-ssh dracut module allows remote unlocking of systems with full disk encryption via ssh