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
- 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
- AADSTS50126 AADSTS50126: Error validating credentials due to invalid username or password
- auth/invalid-credential Firebase Auth: auth/invalid-credential (auth/wrong-password, auth/user-not-found, auth/invalid-login-credentials)
- Authentication token manipulation error passwd: Authentication token manipulation error
Most viewed in Linux
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026