From 10cb9364c6769c144ff8bdb3df33d760db928597 Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Thu, 30 May 2024 02:52:46 +0200 Subject: [PATCH] Make rsync setup script work --- hosts/nixos/lapetus/keys/id_ed25519.pub | 1 + scripts/setup-rsync-ssh.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 hosts/nixos/lapetus/keys/id_ed25519.pub diff --git a/hosts/nixos/lapetus/keys/id_ed25519.pub b/hosts/nixos/lapetus/keys/id_ed25519.pub new file mode 100755 index 0000000..509c8bf --- /dev/null +++ b/hosts/nixos/lapetus/keys/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfOoqEHKR8Cy1GF0XTqMiotJvv5BaHA9u4abTQRSIPO adrielus@lapetus diff --git a/scripts/setup-rsync-ssh.sh b/scripts/setup-rsync-ssh.sh index 2f7b547..a117f30 100755 --- a/scripts/setup-rsync-ssh.sh +++ b/scripts/setup-rsync-ssh.sh @@ -1,2 +1,9 @@ #!/usr/bin/env bash -scp ~/.ssh/id_ed25519.pub $(cat ../hosts/nixos/common/optional/services/restic/url.txt):.ssh/authorized_keys +# Create tmp file +tmpfile=$(mktemp) +# Concat files +cat hosts/nixos/*/keys/id_*.pub > $tmpfile +# Copy concat result +scp $tmpfile $(cat hosts/nixos/common/optional/services/restic/url.txt):.ssh/authorized_keys +# Cleanup file +rm -rf $tmpfile