`kex_exchange_identification: read: Connection reset by peer` during large runs
AdvancedTroubleshootingConnection and SSH Failures
Answer
Likely causes → Too many parallel handshakes exceeding sshd MaxStartups, fail2ban banning the controller, or a bastion with connection limits.
Diagnose → On the target: journalctl -u sshd | grep -i 'drop\|exceeded' and fail2ban-client status sshd.
Fix → Lower forks, enable ControlPersist so handshakes are reused, whitelist the controller in fail2ban, raise MaxStartups 100:30:200.
Prevent → Size forks to the weakest hop in the path.
More on Connection and SSH Failures
`UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: Permission denied (publickey,password)."}`Beginner`UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.0.1.15 port 22: Connection timed out"}`Beginner`UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: ssh: connect to host web01 port 22: Connection refused"}`Beginner`Host key verification failed.` after rebuilding a serverBeginnerThe playbook hangs for ever at "Gathering Facts" on one hostIntermediate`Failed to connect to the host via ssh: Too many authentication failures`Intermediate