建立Centos主機幾個建議

安裝fail2ban

sudo yum install epel-release
sudo yum install fail2ban

編輯設定

sudo nano /etc/fail2ban/jail.local
[sshd]
enabled = true
filter  = sshd
port    = 22
action = %(action_mwl)s
logpath = /var/log/secure
banaction = firewallcmd-ipset

啟動及查看狀態

sudo systemctl start fail2ban
sudo systemctl enable fail2ban
sudo fail2ban-client status
sudo fail2ban-client status sshd

可參考

Read More