I have had several ssh keys in my ~/.ssh/ directory until today and everything worked perfectly fine until I added 3 more keys. I noticed that after reboot I am not able to ssh to a server with a key anymore and I was able to before. When I inspect the ssh connection I can see that ssh is not even reading the key it should read, that's why I get Too mnay authentication failures. When add the key manually: ssh add path/to_key it works.

Why is it not working anymore? It used to work fine until I added a couple of more keys. I have around 10 private and public keys locally in total. Does that matter? Can you give me a hint or some kind of brief explanation how this thing works?

1 Answer 1


This is happening because it is trying all of the keys it knows against the server. If the number of keys it tries before coming upon the right one, exceeds the max number of auth tries, you will get that error.

So it is just good practice to specify.

I created folders and then made profiles to mitigate this type of issue.

  • Make logical groupings of servers so there is say only 5 in each group

  • Make a folder for each group

  • Make a profile for each group

  • Make sure all the servers are set so that 5 auth tries is the max so that you never hit the limit

  • Then just make sure you are in the right profile and your all set for that group of 5.

If you don't have a ton of systems I would just use ~/.ssh/config

Put entries like:

Host dev
    HostName dev.example.com
    Port 22000
    User fooey
Host github.com
    IdentityFile ~/.ssh/github.key
  • I understand now. Good point. What logical grouping and profiles are you refering to? How do I create one? Can you guide me?
    – jedi
    Nov 29, 2018 at 21:57
  • I can but I need to know, How many servers, you are managing. Nov 29, 2018 at 22:04
  • That's what I need :) I have 1 server but multiple users that I use to connect to and several keys for GitHub and 1 for GitLab. Can I use multiple users per Host?
    – jedi
    Nov 29, 2018 at 22:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .