aboutsummaryrefslogtreecommitdiff
path: root/nix/generate-keys.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nix/generate-keys.sh')
-rwxr-xr-xnix/generate-keys.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/nix/generate-keys.sh b/nix/generate-keys.sh
index 611d931..89484e7 100755
--- a/nix/generate-keys.sh
+++ b/nix/generate-keys.sh
@@ -2,6 +2,9 @@
# Generate a host key for a specific host
set -euo pipefail
+# Resolve paths relative to this script, not the caller's CWD
+cd -- "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"
+
HOST="$1"
mkdir -p "./host-keys/${HOST}"
ssh-keygen -t ed25519 -f "./host-keys/${HOST}/ssh_host_ed25519_key" -N ""