# Received disconnect: Too many authentication failures

**Code:** `Too many authentication failures` · **Category:** Linux · **Seen on:** Linux

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

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/linux/too-many-authentication-failures)
