Fail2ban

2024-11-13 linux

fail2ban 安裝

apt install fail2ban -y

狀態

檢查監控的服務

fail2ban-client status

檢查被攔阻的IP

fail2ban-client status zimbra-smtp

設定完成後檢查

fail2ban-regex /var/log/zimbra.log /etc/fail2ban/filter.d/zimbra-smtp.conf

加载所有配置

fail2ban-client reload 

Ban an IP address

fail2ban-client set “Jail-Name” banip “IP-Address”

fail2ban-client set sshd banip 10.137.26.29  

Unban an IP address.

fail2ban-client set “Jail-Name” unbanip “Banned IP-Address”

fail2ban-client set sshd unbanip 10.137.26.29