From d2ea197ce090bcbdaed98b25cd31cb7d00bbefe9 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 5 Nov 2020 14:40:00 -0500 Subject: [PATCH] [fix] Remove old entry for manager from known_hosts Resolves #1839 --- setup/so-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup/so-functions b/setup/so-functions index 0ac1d0446..a5c620440 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -641,6 +641,10 @@ copy_ssh_key() { mkdir -p /root/.ssh ssh-keygen -f /root/.ssh/so.key -t rsa -q -N "" < /dev/zero chown -R "$SUDO_USER":"$SUDO_USER" /root/.ssh + + echo "Removing old entry for manager from known_hosts if it exists" + sed -i "/${MSRV}/d" /root/.ssh/known_hosts + echo "Copying the SSH key to the manager" #Copy the key over to the manager ssh-copy-id -f -i /root/.ssh/so.key soremote@"$MSRV"