> Because initramfs is just a (mostly) normal Linux system, that means it has its own init PID 1. On Arch, that PID is in fact just systemd.<p>Debian has (or had; at least my Devuan still has) a simple shell script as first init. Was an interesting read and helped me understand were to add my remote rootfs decryption.<p><a href="https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/debian/latest/init" rel="nofollow">https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/...</a>
If you want to be able to reboot remotely, and <i>non-interactively</i> (i.e. while you sleep), I (and one other person) created Mandos for this purpose: <<a href="https://www.recompile.se/mandos" rel="nofollow">https://www.recompile.se/mandos</a>>. It gets the password over the network. If this seems insecure to you, read the FAQ: <<a href="https://www.recompile.se/mandos/man/intro.8mandos" rel="nofollow">https://www.recompile.se/mandos/man/intro.8mandos</a>>
I'd love to see this in the bootloader, along with a selection of binaries useful for recovery. Might sound silly but over the years I have had many a remote system get to the bootloader and then no further after an upgrade. Nowadays we've usually got a nicely sized EFI partition, why not stuff it all in there?<p>Or is there already a solution to this that I've been missing?
There is an old but still reasonable solution with mkinitcpio hooks encrypt/sd-encrypt + ssh, which is very easy to set up with EFI or grub2 onward. Tailscale is probably overkill for this use case, given that you're already exposing pre-/early- boot to the network by setting up interfaces that early. This became much more hermetic with secureboot and TPMs, too.
This has been a "need" for a long time for home users with FDE. The go-to software solution for Linux has been:<p><a href="https://github.com/gsauthof/dracut-sshd" rel="nofollow">https://github.com/gsauthof/dracut-sshd</a>
A long time ago, I built my own crashcart adapter with a raspberry pi and a teensy to do something similar. I would sometimes get weird mdadm errors that would hang the boot process and other times, a reboot or power loss wouldn't actually cause the PC to boot back up. The teensy did USB HID emulation for keyboard inputs. I added the ability to push the power button with a fet and some resistors. I had a cheap VGA to composite adapter going into a USB composite capture device so I could at least get screenshots for any weird boot messages. I built a small webpage using flask to display the screenshot, allow for text input, control inputs, and to push the power button. It was a lot of fun building but a basement flood completely wrecked it. Server was sitting on a 6in platform but the crashcart had fallen off the top of the case and was laying on the ground. Oops.
I recently ported the WiFi hook to support systemd based initramfs so you could autoconnect via your WiFi to unlock your device.<p>Give it a go: <a href="https://aur.archlinux.org/packages/mkinitcpio-wifi" rel="nofollow">https://aur.archlinux.org/packages/mkinitcpio-wifi</a>
FYI your decryption key can be MITMed during this process by anyone with physical access to the system, which defeats the purpose of encrypting the disk in the first place.<p>Just use dm-verity for remote servers.
I'm vaguely reminded of some of the third party disk encryption/preboot management utilities that exist in the Windows space that leverage similar technology. Authentication is done against an online source, and only then is the key sent back to the local machine to unlock the disk. The Bitlocker key is kept nowhere near the local TPM.<p>I've only seen it on some paranoid-level devices in industry (typically devices handling biometric identity verification services).<p>IIRC this one is a Linux image that boots up, unlocks the normal Bitlocker partition via whatever mechanism you need, then hands control back to the Windows bootloader to continue onwards.<p><a href="https://winmagic.com/en/products/full-disk-encryption-for-windows/" rel="nofollow">https://winmagic.com/en/products/full-disk-encryption-for-wi...</a>
[flagged]