yum install epel-release yum install fail2ban
apt-get install fail2ban
Ignoreip=127.0.0.1 # Ignored IP list, not restricted by settings (white list) Bantime=600 # shielding time, in seconds Findtime=600 # If the specified number of times is exceeded in this period, it will be blocked Maxretry=3 # maximum attempts Backend=auto # Log modification detection mechanism (gamin, polling and auto) [ssh iptables] # Check the configuration of each service, such as setting bantime, findtime, maxretry and global conflict. The service priority is higher than the global setting Enabled=true # Whether to activate this item (true/false) Filter=sshd # Name of the filter rule, corresponding to sshd.conf in the filter.d directory Action=iptables [name=SSH, port=ssh, protocol=tcp] # Action related parameters sendmail-whois[name=SSH, dest=root, sender= fail2ban@example.com ]# Recipients who triggered the alarm Logpath=/var/log/secure # The login log file of the detected system Maxretry=5 # maximum attempts
Copyright notice: This is an original article, and the copyright belongs to Rat's Blog All, please indicate the source for reprinting!
Link to this article: https://www.moerats.com/archives/153/
If the tutorial needs to be updated, or 404 appears on the related link, you can leave a comment below the article.