sane-scripts.private-unlock-remote: init
This commit is contained in:
@@ -138,6 +138,11 @@ let
|
||||
srcRoot = ./src;
|
||||
pkgs = [ "util-linux.mount" ];
|
||||
};
|
||||
private-unlock-remote = static-nix-shell.mkBash {
|
||||
pname = "sane-private-unlock-remote";
|
||||
srcRoot = ./src;
|
||||
pkgs = [ "openssh" "sane-scripts.secrets-dump" ];
|
||||
};
|
||||
rcp = static-nix-shell.mkBash {
|
||||
pname = "sane-rcp";
|
||||
srcRoot = ./src;
|
||||
|
14
pkgs/additional/sane-scripts/src/sane-private-unlock-remote
Executable file
14
pkgs/additional/sane-scripts/src/sane-private-unlock-remote
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p bash -p openssh -p sane-scripts.secrets-dump
|
||||
|
||||
# unlock a remote private store by dropping the password in a discoverable place.
|
||||
# this only works if our own private store has been unlocked and this machine has access to the relevant secret.
|
||||
|
||||
set -xeu
|
||||
|
||||
host=$1
|
||||
passwd=$(sane-secrets-dump --field password "$host")
|
||||
|
||||
test -n "$passwd"
|
||||
|
||||
echo "$passwd" | ssh "$host" 'if ! test -f /mnt/persist/private/init; then cat /dev/stdin > /run/gocryptfs/private.key; fi'
|
Reference in New Issue
Block a user