Too many authentication failures 🐧 Linux

Received disconnect: Too many authentication failures

Your SSH agent offered too many keys before the right one, and the server cut the connection (MaxAuthTries, default 6).

Seen on: Linux

Meaning

ssh tries every key loaded in the agent plus default key files. With many keys loaded, the server gives up before the correct one is offered.

Common causes

  • Many keys in ssh-agent
  • Server MaxAuthTries lower than the number of keys tried
  • Wrong key altogether

⚡ Quick fix

  1. Specify the key and disable others: ssh -o IdentitiesOnly=yes -i ~/.ssh/key user@host
  2. Add IdentitiesOnly to ~/.ssh/config
  3. Remove unneeded keys from the agent (ssh-add -D)

Detailed fix by platform

Shell

  1. bash
    # ~/.ssh/config
    Host myserver
      HostName 203.0.113.10
      User deploy
      IdentityFile ~/.ssh/deploy_ed25519
      IdentitiesOnly yes

How to diagnose

  1. Agent — ssh-add -l (how many keys?)
  2. Debug — ssh -v shows which keys are offered

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.