WorkHolic

CentOS 5 fail2ban 설치

gromet 2023. 12. 21. 19:23
728x90
반응형

 

 

CentOS 5 fail2ban 설치

 

ssh 무작위 접속 시도 차단에 fail2ban이 좋다.
아래와 같이 설치하면 된다.

 

1. EPEL Repo 설치

CentOS/RHEL 5, 64 Bit (x86_64):
# rpm -Uvh http://dl.fedoraproject.org/pub/archive/epel/5/x86_64/epel-release-5-4.noarch.rpm


2. fail2ban 설치

yum install fail2ban


3. /etc/fail2ban/jail.conf 수정

[ssh-iptables]

enabled  = true
filter   = sshd
action   = iptables[name=SSH, port=ssh, protocol=tcp]
           sendmail-whois[name=SSH, dest=you@example.com, sender=fail2ban@example.com, sendername="Fail2Ban"]
logpath  = /var/log/secure
maxretry = 5

4. 서비스 시작

/etc/init.d/fail2ban start

[root@kl151 fail2ban]# /etc/init.d/fail2ban start
Starting fail2ban:                                         [  OK  ]
[root@kl151 fail2ban]# fail2ban-client status
Status
|- Number of jail:      1
`- Jail list:           ssh-iptables

 

#CentOS5 #fail2ban

 

 

728x90
SMALL