fix(init): prune stale hostkeys with ssh-keygen -R prior to bootstrap

This commit is contained in:
v 2026-10-26 11:57:32 +03:00
parent c6ac523287
commit 9361094805

View file

@ -96,6 +96,11 @@ fi
PUBKEY_B64=$(ssh-keygen -y -f "${RAM_KEY}" | base64 -w0) PUBKEY_B64=$(ssh-keygen -y -f "${RAM_KEY}" | base64 -w0)
ssh-keygen -R "${TARGET_IP}" >/dev/null 2>&1 || true
ssh-keygen -R "${ALIAS}" >/dev/null 2>&1 || true
ssh-keygen -R "[${TARGET_IP}]:${PORT}" >/dev/null 2>&1 || true
ssh-keygen -R "[${TARGET_IP}]:22" >/dev/null 2>&1 || true
log_info "Инициализация ноды ${ALIAS} (${TARGET_IP}:${PORT})..." log_info "Инициализация ноды ${ALIAS} (${TARGET_IP}:${PORT})..."
ssh -o StrictHostKeyChecking=accept-new -p 22 "root@${TARGET_IP}" \ ssh -o StrictHostKeyChecking=accept-new -p 22 "root@${TARGET_IP}" \