보안

Ubuntu 20.04 - SSH에 fail2ban 적용

T8.CO.KR 2026. 9. 24. 14:17

sudo apt update
sudo apt upgrade -y
sudo apt install fail2ban -y
fail2ban-client -V
sudo systemctl status fail2ban.service
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo vi /etc/fail2ban/jail.local *주석 해제 및 수정


[DEFAULT]
ignoreip = 127.0.0.1/8 ::1
bantime = 10m
findtime = 10m
maxretry = 5

[sshd]
port= ssh
enabled= true


sudo systemctl restart fail2ban.service
sudo systemctl enable fail2ban