IT How Tos

Home

About

Sitemap

Contact

SSH Too Many Authentication Failures

Nature of error

When an attempt from a SSH client connects to an SSH server – a failed authentication error appears, similar to this:
Received disconnect from X.X.X.X port 22:2: Too many authentication failures
Disconnected from X.X.X.X port 22

Cause

This is usually caused by inadvertently offering multiple ssh keys to the server. The server will reject any key after too many keys have been offered.
SSH client tries each key in order, until it finds one that works. The SSH server allows only so many authentication attempts before the connection is declined and rejected.

The Fix

  • The SSH client option can resolve this as follows:
    ssh -o IdentitiesOnly=yes
  • As follows:
    ssh -o IdentitiesOnly=yes -i /home/omerwarman/.ssh/ithowtos_rsa foo.ithowtos.com

SSH Client config fix

  • The fix can be set in the ssh config as follows:
Host *.example.com
  IdentitiesOnly yes
  • or – in order to set in on all instances
Host *
  IdentitiesOnly yes

Further Reading