
Fail2ban에서 모든 이벤트에 대한 알림 이메일을 받고 싶습니다. 구성 파일 전체에 대상 변수가 흩어져 있는 것 같습니다 /etc/fail2ban
./etc/fail2ban/action.d
모든 이벤트에 대해 하나의 대상 이메일을 설정하는 방법이 있습니까? 이에 대한 최신 문서를 찾을 수 없는 것 같습니다.
Jail.local에는 다음이 포함됩니다.
# ban & send an e-mail with whois report to the destemail.
action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
그런데 어디에 destemail
설정되어 있나요? 또한 작동하는지 빠르게 테스트하는 방법을 아는 것도 유용할 것입니다 destemail
.
답변1
/etc/fail2ban/jail.local
에서 복사된 (centos 6.7) 에 있는 것 같습니다 jail.conf
.
메일 배달이 작동하는지 테스트하는 하나의 라이너는 다음과 같습니다.
echo "My message" | mail -s subject [email protected]