This is the quickest way to limit the number of connection to your SSH server with iptables.
sudo /sbin/iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 5 -j REJECT
This will only allow up to 5 concurrent connections to the SSH server, subsequent connections will be rejected by iptables, thus this can thwarts Brute-force attempts to your server.
More Articles About Securing SSH Server
- Force Users to Use Secure Password
- Iptables rule to safeguard SSH server from crackers
- How to restrict or allow SSH access to certain users only in Linux