Fail2ban is a free and open source software that you can configuration with iptables to stop automated bots to gain access to SSH session server on Linux based system.
From the tutorial page:
SSH allows you to log in to a remote computer or server and control it through a command-line interface. However, because SSH is exposed to the internet; attackers can try to log in by trying various username and password combinations.
A good way to protect SSH would be to ban an IP address from logging in if there are too many failed login attempts. Fail2ban does this right out of the box. In addition, you can even configure Fail2ban to protect other applications, like web servers.
We’ll cover how to protect SSH with Fail2ban in this post.
- Read more: Protecting SSH with Fail2ban