Using full-disk encryption on a dedicated server running NixOS

lr flag

I run NixOS Linux on a Hetzner dedicated server which was installed from the Rescue system using this script, which sets up the disks using RAID1 and LVM.

I'd like add full-disk encryption to this install script. The NixOS manual recommends LUKS ... but this will have the user manually enter the encryption passphrase during boot time in front of the actual console (neither physically nor virtually accessible to me; at least with Hetzner) - something that's not directly possible when renting a dedicated server from another country.

One person recommended using a SSH service during initrd boot (see the corresponding Nix config) - but I do not know what the full setup would be? Apparently, you would ssh to the still-being-booted machine to manually enter the passphrase, somehow triggering the boot process to complete.

Question: how do you do this in Nix? More specifically, how would you patch the aforementioned install script to achieve this automatically?

anx avatar
fr flag
If you are concerned with someone stealing your disks, should you not instead use a different hosting provider? Are you sure you do not have more pressing security threats to address if you are willing to spend this much on maintaining an unsupported configuration? Remote unlocking servers has forever been unreliable because nobody bothers to fix it in any mainstream distro because its mostly pointless..

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.