fix(ssh): operator scripts tell a changed host key apart from missing data #84

Merged
jfraeys merged 1 commit from jfraeys/fix/operator-ssh-hostkey-recycled-ip into main 2026-10-12 23:14:53 -04:00
Owner

StrictHostKeyChecking=accept-new in the operator scripts is right for long-lived production hosts, but after a DR rebuild on a recycled IP ssh refuses with a changed host key, and the scripts reported that as something else:

  • scripts/lib/setup/recovery.sh: the critical-data check treated any ssh failure as 'path missing', so a changed host key on a healthy node produced the 'restore from backup' banner. ssh exit 255 now returns 2 (data state unknown), prints one SSH-ERROR line with the ssh-keygen -R hint, and check_data_recovery_needed warns instead of declaring data missing. Verified with a fake ssh (rc 0/1/255 -> 0/1/2).
  • scripts/lib/manage/core.sh (ssh_check) and node.sh: the failure message now says the host key changed and how to clear it, instead of 'may need key authentication'.

Production pinning is unchanged (no host-key checking is weakened).

Plan: L4 of the loose-ends track.

🤖 Generated with Claude Code

StrictHostKeyChecking=accept-new in the operator scripts is right for long-lived production hosts, but after a DR rebuild on a recycled IP ssh refuses with a changed host key, and the scripts reported that as something else: - scripts/lib/setup/recovery.sh: the critical-data check treated any ssh failure as 'path missing', so a changed host key on a healthy node produced the 'restore from backup' banner. ssh exit 255 now returns 2 (data state unknown), prints one SSH-ERROR line with the ssh-keygen -R hint, and check_data_recovery_needed warns instead of declaring data missing. Verified with a fake ssh (rc 0/1/255 -> 0/1/2). - scripts/lib/manage/core.sh (ssh_check) and node.sh: the failure message now says the host key changed and how to clear it, instead of 'may need key authentication'. Production pinning is unchanged (no host-key checking is weakened). Plan: L4 of the loose-ends track. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ssh): operator scripts tell a changed host key apart from missing data
All checks were successful
Lint / lint (pull_request) Successful in 1m49s
Secret scan / scan (pull_request) Successful in 14s
5a350a4f01
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!84
No description provided.