기술노트
fail2ban 으로 일정횟수 이상의 접속 실패 IP 차단 | |
---|---|
작성자 : 관리자(jieun@ehostidc.co.kr) 작성일 : 2018-11-08 조회수 : 4635 | |
fail2ban 으로 일정횟수 이상의 접속 실패 IP 차단
CentOS 7 환경
1. 저정소 추가 # rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 2. 패키지 설치 # yum --enablerepo epel install fail2ban ![]() # systemctl enable fail2ban
3. 환경 설정
4. 별도 설정 파일 ( 별도 파일 생성을 통한 관리) # vi /etc/fail2ban/jail.local
5. 서비스 확인 a. iptables 룰셋 확인 ![]()
b. 전체 상태 # fail2ban-client status c. 서비스별 상태 # fail2ban-client status sshd d. ipset 설정(차단) 확인 # ipset --list e. fail2ban 로그 확인 awk '($(NF-1) = /Ban/){print $NF}' /var/log/fail2ban.log | sort | uniq -c | sort -n ![]() |
|
이전글 | CentOS 6 IPTABLES 정리 |
다음글 | [Linux] 서버간 시간 동기화 chrony |