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).
Too many authentication failuresReceived disconnect from port 22:2: Too many authentication failuresDisconnected from 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
- Specify the key and disable others: ssh -o IdentitiesOnly=yes -i ~/.ssh/key user@host
- Add IdentitiesOnly to ~/.ssh/config
- Remove unneeded keys from the agent (ssh-add -D)
Detailed fix by platform
Shell
- bash
# ~/.ssh/config Host myserver HostName 203.0.113.10 User deploy IdentityFile ~/.ssh/deploy_ed25519 IdentitiesOnly yes
How to diagnose
- Agent — ssh-add -l (how many keys?)
- 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:
Similar errors
- 530 5.7.0 Authentication Required SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required
- 534 5.7.9 Application-specific password required SMTP: 534-5.7.9 Application-specific password required. Learn more at https://support.google.com/accounts/answer/185833
- AADSTS50126 AADSTS50126: Error validating credentials due to invalid username or password
Most viewed in Linux
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 14 Oct 2026