3 ms·
Dropbear works well for preboot LUKS unlocking with remote servers.
by mirimir 8y ago
Dropbear works well for preboot LUKS unlocking with remote servers.
- arminiusreturns 8y agoThis is how I've used it as well. (Initram luks shim, I call it)
- SpaceGorilla 8y agoHuh, this sounds too good to be true. Remote FDE? Yes please!
- teddyh 8y ago(Shameless plug:) For automatic unlocking at unattended reboots of LUKS-locked remote servers, see Mandos: https://www.recompile.se/mandos https://www.recompile.se/mandos
- mirimir 8y agoYes, this is devilish clever stuff :)
- aesh2Xa1 8y agoHow's that work? Are you unlocking, say, a rootfs on boot or something entirely different? I'm curious about the use case and the method.
- loxias 8y agoCurrently, all my remote servers of any import use LUKS to encrypt the PVs. My /boot is a tiny unencrypted filesystem containing just the kernel, and an initrd, which prompts for my decryption key before booting. (afaict, the standard setup) For remote servers, I reboot them and then have to use a serial console to type in the LUKS password. Are you saying that with this, I could put an ssh server in the initrd (and I guess I'd have to make sure network was up as well), that I could log in to to provide my LUKS password???? Because that would be ... beautiful.
- bleke 8y agoYes you can and start whatever program you want, take i look at better-initramfs (https://github.com/slashbeast/better-initramfs https://github.com/slashbeast/better-initramfs), although it is more for gentoo/funtoo. Basicaly when linux boot from initrd it starts "/init" executable and chroots to your system (ok, it is using pivot_root and it is slightly more complex), but idea it is same as manually mounting filesystems and doing chroot then starting executable /bin/init
- gh2k 8y agoThere's also an example script on the Gentoo wiki that might serve as a good starting point: https://wiki.gentoo.org/wiki/Custom_Initramfs/Examples#Simple_initramfs_for_unlocking_LUKS_encrypted_root_remotely_over_SSH https://wiki.gentoo.org/wiki/Custom_Initramfs/Examples#Simpl...
- mkj 8y agoFor Ubuntu or Debian the dropbear-initramfs package should handle most of it, it looks like https://hamy.io/post/0005/remote-unlocking-of-luks-encrypted-root-in-ubuntu-debian/ https://hamy.io/post/0005/remote-unlocking-of-luks-encrypted... is an alright run through. Another approach is to use something like OpenWRT as a bootloader then pivot_root into the real distribution after unlocking it - not sure there are any good instructions online for that though. I'm using it on a Raspberry Pi colocated 14000km away for https://dropbear.nl https://dropbear.nl, it works pretty well. Kexec is great for remote kernel upgrades too.
- loxias 8y agoYou are rocking my world. :D When I first started switching my VPSs to having full disk encryption, I think it was around lenny though it might have been squeeze. Anyway, me and another peer thought it would be good practice to, while we figured we'd never cover every possible surface, find a standard deployment for debian VMs where even though we have no physical access to the hosts, wherever possible minimized the ability of an employee at a hosting company accessing our precious, precious bits. The memory hadn't come back when I wrote my first comment, but one of the ideas we had at the time was shoving sshd inside the initrd! But we concluded it would be hard -- involving not only making a static build of sshd (which I did some eons ago when I had foolish opinions concerning /bin /usr/bin) but also probably trimming code away from it or adding executable compression, and modifying the initrd creation scripts....either way -- too much complexity. So I went the route previously described. Now I learn that not only is there an ssh implementation which i can statically link into a tiny binary (which helps some other projects...), but someone went threw the trouble of making a modified initrd package with it! Fantastic. Look for an email from me soon offering help on a specific project I noticed on your github... I'm well aware of building my own scripts that use chroot/pivot_root tricks -- I personally like using them for making small boxes that run everything from ram and keep no persistent state. But just out of random curiosity, what's the advantage of using OpenWRT?