iT邦幫忙

0

linux sentos 的fail2ban 網域變更後fail2ban不會自動更改?

  • 分享至 

  • twitterImage

請問我原本測試的網域是domain1.com.tw,現在改成domain2.com.tw

但是fail2ban好像不會自動的改,還是一直想寄系統通知信到root@domain1.com.tw
不是改寄到root@domain2.com.tw的信箱裡,這怎麼辦呢?

我找不到地方可以改這個的,

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
12
sl6xx
iT邦研究生 5 級 ‧ 2010-07-07 19:56:24
最佳解答

raytracy說得沒錯。不過那個檔案要看您的rpm是哪裡來的,不同的來源可能設定檔會放在不同的地方。我們的fail2ban中,這個設定檔是在: /etc/
另外,通常root是用alias指到某個收件人。會不會只改了domain但是是alias沒有改?

您好,我的是在atrpm用yum下來的
好像和原版有點不同,明天到公司在看看

您好,我alias都沒有設定,不過您給我了一個方向

我想到之前有設過.forward把給root的信都轉給user1@domain1.com.tw

現在把它改為user1@domain2.com.tw試試

應該是這個問題

14
Ray
iT邦大神 1 級 ‧ 2010-07-07 17:03:56

找一下 fail2ban 目錄底下, 是否有這個檔案:

config/action.d/mail.conf

改內容看看...

看更多先前的回應...收起先前的回應...

我全都用預設的

Fail2Ban configuration file

Author: Cyril Jaquier

$Revision: 660 $

[Definition]

Option: actionstart

Notes.: command executed once at the start of Fail2Ban.

Values: CMD

actionstart = printf %%b "Hi,\n
The jail <name> has been started successfully.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: started" <dest>

Option: actionstop

Notes.: command executed once at the end of Fail2Ban

Values: CMD

actionstop = printf %%b "Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped" <dest>

# Option: actioncheck

Notes.: command executed once before each actionban command

Values: CMD

actioncheck =

Option: actionban

Notes.: command executed when banning an IP. Take care that the

command is executed with Fail2Ban user rights.

Tags: <ip> IP address

<failures> number of failures

<time> unix timestamp of the ban time

Values: CMD

actionban = printf %%b "Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip>" <dest>

# Option: actionunban

Notes.: command executed when unbanning an IP. Take care that the

command is executed with Fail2Ban user rights.

Tags: <ip> IP address

<failures> number of failures

<time> unix timestamp of the ban time

Values: CMD

actionunban =

[Init]

Defaut name of the chain

name = default

Destination/Addressee of the mail

dest = root

有想過要改dest,不知道是不是這個

但是為什麼原本dest=roor,它會知道=root@domain1.com.tw?

一定有地方是有記到舊domain1的.

Ray iT邦大神 1 級 ‧ 2010-07-08 13:44:47 檢舉

dest=roor 會直接寄給本機的 root, 但若你本機 root 有導向到其他帳號去的話, 信就會跟著到其他帳號去....

8
shunyuan
iT邦研究生 1 級 ‧ 2010-07-07 17:32:37

CentOS 才對吧?

我要發表回答

立即登入回答