fix re-adoption

This commit is contained in:
Paolo Asperti 2020-03-07 20:51:07 +01:00
parent 31d6f096cf
commit 20f51f3aba
Signed by: paspo
GPG Key ID: 06D46905D19D5182
1 changed files with 1 additions and 0 deletions

View File

@ -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"