`Failed to connect to the host via ssh: Too many authentication failures`
IntermediateTroubleshootingConnection and SSH Failures
Answer
Likely causes → ssh-agent holds many keys and the server hits MaxAuthTries before reaching the right one.
Diagnose → ssh-add -l, then ssh -vvv host to see keys offered.
Fix →
[ssh_connection]
ssh_args = -o IdentitiesOnly=yes
and set ansible_ssh_private_key_file explicitly.
Prevent → Use IdentitiesOnly=yes and one key per environment.
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`fatal: [web01]: UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: Shared connection to web01 closed."}` mid-runIntermediate