Protecting SSH with Fail2ban

A determined attacker may try to brute force a user's password to gain access or attempt repeated logins to consume network and system resources as part of a denial of service attack. Fail2ban can help protect you from such attacks by monitoring a server's log files, identifying suspicious activity, and automatically banning the IP addresses responsible for the activity. This recipe teaches you how to install Fail2ban to safeguard your system.

Getting ready

This recipe requires a CentOS system running the OpenSSH server. Administrative privileges are also required, either by logging in with the root account or through the use of sudo. The fail2ban package is hosted by the EPEL repository; if the repository is not already ...

Get CentOS 7 Server Deployment Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.