From 20f51f3aba36aba50198a14de276d10ff0034e8a Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Sat, 7 Mar 2020 20:51:07 +0100 Subject: [PATCH] fix re-adoption --- root/etc/e-smith/events/actions/client-adopt | 1 + 1 file changed, 1 insertion(+) diff --git a/root/etc/e-smith/events/actions/client-adopt b/root/etc/e-smith/events/actions/client-adopt index 15b9982..e4f90b1 100644 --- a/root/etc/e-smith/events/actions/client-adopt +++ b/root/etc/e-smith/events/actions/client-adopt @@ -35,6 +35,7 @@ if [[ "$AMIROOT" = "" ]]; then fi PUB=$(db configuration getprop client-manager ManagementKeyFile) +ssh-keygen -R "${HOST}" cat $PUB | \ sshpass -p "${PASS}" ssh -t -o StrictHostKeyChecking=no "${USER}@${HOST}" "echo '${PASS}' | sudo -S mkdir /root/.ssh >/dev/null ; sudo tee -a /root/.ssh/authorized_keys"