“A service called fail2ban can mitigate this problem (edit: SSH being public) by creating rules that can automatically alter your iptables firewall configuration based on a predefined number of unsuccessful login attempts. This will allow your server to respond to illegitimate access attempts without…”
— Justin Ellingwood, How To Protect SSH with Fail2Ban on Ubuntu 14.04