Photo of Torben Hansen

A TechBlog by Torben Hansen


Freelance Full Stack Web Developer located in Germany.
I create web applications mainly using TYPO3, PHP, Python and JavaScript.
Home Archive Tags

SSH reports "Too many Authentication Failures" on first connect

Today I wanted to connect to a new clients SSH server and received a “Too many Authentication Failures” message just on the first connect to the host. After a short break and some Google research, I found the very simple reason for the message.

Since I have several SSH keys in my .ssh/ directory, SSH tries to use each of it to connect to the SSH server. So when the SSH server has a very low “MaxAuthTries” setting configured, then the SSH connection may fail before password authentication is offered.

In order to connect a SSH servers with a low “MaxAuthTries” setting, you can use the following command:

ssh -o PubkeyAuthentication=no [email protected]

After using the “PubkeyAuthentication=no” option, I could login to the host and add a SSH public key to the .ssh/authorized_keys file.