Skip to content

How to fix ‘SSH too many authentication failures’ error?

Connecting to a remote machine via SSH is simple, easy and gets pretty much everything you’d need to do over a remote connection done. However, it’s not always as seamless as entering a command in the terminal and hitting enter to connect.

At times users may not able be able to connect to a remote client via SSH and get an “SSH too many authentication failures” error instead. In this article, we’re going over what this error is and how you can get rid of this.

Also read: What is SFTP? How to transfer files using SFTP?


What causes the ‘SSH too many authentication failures’ error?

This error is caused by inadvertently having way too many SSH keys in the ssh-agent file. When attempting to connect to an SSH client, the remote server would try all the keys, and if it doesn’t find the particular identity key it needs, it throws this error.

If the server is being offered too many keys, it’ll reject any key after too many tries. You can check this for yourself by adding the -v flag in your SSH command to get verbose output and check just how many keys are being offered.


How to fix the ‘SSH too many authentication failures’ issue?

To fix this problem, you have to prevent irrelevant keys from being offered to the server. We’re going to have to explicitly specify this in every host entry in the SSH configuration on the client machine by adding IdentitiesOnly for the host connection.

Step 1: Open the SSH configuration file using the command below.

vim ~/.ssh/config
How to fix 'SSH too many authentication failures' error?

Step 2: Add the following line under the Hosts* section of the file.

IdentitiesOnly=yes
How to fix 'SSH too many authentication failures' error?

Alternatively, you can also mention this in the SSH command like this.

ssh -o IdentitiesOnly=yes [email protected]

Also read: How to enable SSH on Ubuntu?

Hello There!

If you like what you read, please support our publication by sharing it with your friends, family and colleagues. If you're running an Adblocker, we humbly request you to whitelist us.

Share on facebook
Share on whatsapp
Share on twitter
Share on reddit
Share on linkedin
Share on pocket
Share on pinterest
Share on telegram
Share on stumbleupon
Share on digg
Share on tumblr
Share on email
Share on skype
Share on xing
Share on vk
Share on odnoklassniki
Share on mix








>