Too many authentication failures Linux Origin: Platform & cloud Last updated 14 Oct 2026

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).

Exact message you may see Too many authentication failuresReceived disconnect from port 22:2: Too many authentication failuresDisconnected from
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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

530 5.7.0 Authentication Required — SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required (Email / SMTP)530 5.7.0 Authenticat…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 (Email / SMTP)534 5.7.9 Application…AADSTS50126 — AADSTS50126: Error validating credentials due to invalid username or password (Azure)AADSTS50126auth/invalid-credential — Firebase Auth: auth/invalid-credential (auth/wrong-password, auth/user-not-found, auth/invalid-login-credentials) (Authentication)auth/invalid-credenti…Authentication token manipulation error — passwd: Authentication token manipulation error (Linux)Authentication token …bad auth : Authentication failed — MongoDB: MongoServerError: bad auth : Authentication failed (code 8000 / 18) (MongoDB)bad auth : Authentica…client_loop: send disconnect: Broken pipe — client_loop: send disconnect: Broken pipe (SSH session drops when idle) (Linux)client_loop: send dis…Could not load the default credentials — Google Cloud: Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started (Google Cloud / Firebase)Could not load the de…Too many …

Explore the map of this error Full error map →

🧠 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.