fail2ban/fail2ban — pull request #707 by eukarpov (2014-04-24 18:27:02+00:00)
Title: Filtering authentication errors when access is available only with ssh keys

In case when access is not available with password it will be useful to ban hosts which come without ssh keys.

messages in auth.log
Received disconnect from 0.0.0.0: 11: Bye Bye [preauth]
Connection closed by 0.0.0.0 [preauth]

I suggest to add those regex in sshd.conf
^%(__prefix_line)sReceived disconnect from : 11: Bye Bye \[preauth\]$
^%(__prefix_line)sConnection closed by \[preauth\]$