Created
July 4, 2023 06:39
-
-
Save delan/b06285bcb8606c2522d05d068a166243 to your computer and use it in GitHub Desktop.
LUKS remote unlock over ssh for NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
stty -echo | |
if ! ssh "root@$1" ' | |
set -eu | |
printf '\''unlocking luks on '"$1"': '\'' | |
sed q > /crypt-ramfs/passphrase. | |
echo | |
mv /crypt-ramfs/passphrase. /crypt-ramfs/passphrase | |
'; then | |
echo failed | |
fi | |
stty echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment