Cannot connect to sftp server — “Too many authentication failures for user”

I faced this issue when trying to use Filezilla client to access a remote ftp location.

The initial stack trace ( with debug level set to 3) is as follows.

Trace:   Trying Pageant key #0
Trace: Server refused public key
Trace: Trying Pageant key #1
Trace: Server refused public key
Trace: Trying Pageant key #2
Trace: Received disconnect message (protocol error)
Trace: Disconnection message text: Too many authentication failures for facade
Trace: Server sent disconnect message
Trace: type 2 (protocol error):
Trace: "Too many authentication failures for facade"
Error: Server sent disconnect message
Error: type 2 (protocol error):
Error: "Too many authentication failures for facade"
Trace: CSftpControlSocket::ResetOperation(66)
Trace: CControlSocket::ResetOperation(66)
Error: Could not connect to server
Status: Waiting to retry...

I identified that the reasons for this issue are follows.

  1. At the time of the issue, I had used “ssh-add” to add several keys for accessing multiple other instances.
  2. FileZilla does’t know which keys it needs to try and tries every available keys
  3. The server had set a maximum retry count (3) and as I had more than 3 keys, FileZilla failed after trying only 3 keys.
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.