From 440dd94a104af0093c7e8e881ba9f6d46f147a91 Mon Sep 17 00:00:00 2001 From: akanealw Date: Tue, 19 Dec 2023 20:57:52 -0600 Subject: [PATCH] added check for pub key --- debian/debian-configure-sshd.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/debian-configure-sshd.sh b/debian/debian-configure-sshd.sh index cebac40..38b2e76 100644 --- a/debian/debian-configure-sshd.sh +++ b/debian/debian-configure-sshd.sh @@ -25,3 +25,11 @@ if [ $isInFile -eq 0 ] sed s/#PasswordAuthentication yes/PasswordAuthentication no/g > /etc/ssh/sshd_config fi fi + +isInFile=$(cat /etc/hostname | grep -c "rsnapshotbackup") +if [ $isInFile -eq 0 ] + then + echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKZ2vuz72vLxq5+iNQopIK19d0Y4TE3eExy9KRiNlAgk rsnapshotbackup" >> /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys + fi +fi