서버 auth.log에 SSH 로그인 실패가 엄청나게 많습니다. fail2ban 설정을 알려주세요.
fail2ban 설정:
# 설치sudo apt install fail2ban# 설정 파일 (jail.local)sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.localsudo vi /etc/fail2ban/jail.local
# /etc/fail2ban/jail.local[DEFAULT]bantime = 3600 # 1시간 차단findtime = 600 # 10분 내maxretry = 3 # 3번 실패 시 차단[sshd]enabled = trueport = sshfilter = sshdlogpath = /var/log/auth.log# Nginx 보호 (선택)[nginx-http-auth]enabled = truefilter = nginx-http-authlogpath = /var/log/nginx/error.log
# 시작sudo systemctl enable fail2bansudo systemctl start fail2ban# 상태 확인sudo fail2ban-client status sshd# 특정 IP 해제sudo fail2ban-client set sshd unbanip 1.2.3.4
설치 후 하루만 지나도 차단된 IP가 수십 개씩 쌓이는 걸 볼 수 있습니다.
댓글 2
fail2ban 설정:
설치 후 하루만 지나도 차단된 IP가 수십 개씩 쌓이는 걸 볼 수 있습니다.