scripts/refresh-*: StrictHostKeyChecking=accept-new on first connect

BatchMode=yes (which the scripts set) implies strict host key checking
and refuses to prompt — so first-time SSH to a host that isn't in
known_hosts fails with "Host key verification failed". Every new host
we register needs a manual `ssh <host>` round-trip first to store the
key before the refresh scripts can reach it.

accept-new fixes that: unknown hosts are auto-accepted into
known_hosts on first connect; subsequent key CHANGES still fail loudly
(as they should — that'd be a MITM signal).

Matches the pattern already used by deploy-stack.sh.

Affects only refresh-server-info.sh and refresh-proxmox-info.sh;
deploy-stack.sh + sync-stacks.sh use their own targets that may or may
not want the same treatment (leaving alone for now).
This commit is contained in:
vh
2026-04-21 16:53:56 -07:00
parent 017f8f9b76
commit fd1c9287cd
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -233,7 +233,7 @@ for host in "${HOSTS[@]}"; do
mkdir -p "$SERVERS_DIR/$host"
if ssh -o BatchMode=yes -o ConnectTimeout=10 "$target" 'bash -s' < "$INSPECT" > "$tmp" 2> "$tmp.err"; then
if ssh -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new "$target" 'bash -s' < "$INSPECT" > "$tmp" 2> "$tmp.err"; then
mv "$tmp" "$out"
rm -f "$tmp.err"
bytes=$(wc -c < "$out")
+1 -1
View File
@@ -240,7 +240,7 @@ for host in "${HOSTS[@]}"; do
mkdir -p "$SERVERS_DIR/$host"
if ssh -o BatchMode=yes -o ConnectTimeout=10 "$target" 'bash -s' < "$INSPECT" > "$tmp" 2> "$tmp.err"; then
if ssh -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new "$target" 'bash -s' < "$INSPECT" > "$tmp" 2> "$tmp.err"; then
mv "$tmp" "$out"
rm -f "$tmp.err"
bytes=$(wc -c < "$out")