From c8c86b2ac072bde350cb4c45c48e89bba8ed393d Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 7 Jun 2024 18:05:04 +0200 Subject: [PATCH] correction ssh keygen 3 --- bin/setup_ssh_keys.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/setup_ssh_keys.sh b/bin/setup_ssh_keys.sh index e62d387..fabd89d 100644 --- a/bin/setup_ssh_keys.sh +++ b/bin/setup_ssh_keys.sh @@ -15,7 +15,5 @@ ssh-copy-id -p ${RECEIVING_PORT} ${RECEIVING_USER}@${RECEIVING_IP} hostname=$(hostname) ssh -p $RECEIVING_PORT $RECEIVING_USER@$RECEIVING_IP << EOF - awk '/${hostname}$/ {last=\$0; count++} {lines[NR]=\$0} END {for (i=1; i<=NR; i++) if (lines[i] !~ /$(hostname)$/ || count-- == 1) print lines[i]}' /home/${RECEIVING_USER}/.ssh/authorized_keys - > /home/${RECEIVING_USER}/.ssh/authorized_keys.tmp - && mv /home/${RECEIVING_USER}/.ssh/authorized_keys.tmp /home/${RECEIVING_USER}/.ssh/authorized_keys + awk '/${hostname}$/ {last=\$0; count++} {lines[NR]=\$0} END {for (i=1; i<=NR; i++) if (lines[i] !~ /$(hostname)$/ || count-- == 1) print lines[i]}' /home/${RECEIVING_USER}/.ssh/authorized_keys > /home/${RECEIVING_USER}/.ssh/authorized_keys.tmp && mv /home/${RECEIVING_USER}/.ssh/authorized_keys.tmp /home/${RECEIVING_USER}/.ssh/authorized_keys EOF \ No newline at end of file