#2
|
|||
|
|||
![]()
iptable
apf 都可以用 |
#5
|
||||
|
||||
![]()
http://phorum.vbird.org/viewtopic.ph...ghlight=ban+ip
這個如果是appserv的話可以用 如果針對主機的話 iptable 該站上的討論超多 可惜我看不懂 |
#6
|
||||
|
||||
![]()
之前蒐集的文章 關於appache的設定
Includes=允許SSI 另外,可用 Options All 取代 Options Indexes FollowSymLinks ExecCGI Includes Options None 即不使用上述的選項 AllowOverride None AllowOverride 即是 .htaccess 可否取代在此設定的目錄設定,可用 All (全部可取代) , None (不能取代) , AuthConfig (允許驗證的使用) , FileInfo (允許控制文件型態) , Indexes (允許控制目錄索引) , Limit (允許控制存取) , Options (允許控制特定目錄特色) Order allow,deny Allow from all Allow from all 即全部人可存取. 如:Order deny,allow Deny from all Allow from abcde.com 即只有網域於 abcde.com 方可存取 |
#7
|
|||
|
|||
![]()
裝apf吧。
1.用root登入 SSHt. 2. cd /usr/src 3. wget http://rfxnetworks.com/downloads/apf-current.tar.gz 4. tar -xvzf apf-current.tar.gz 5. rm -f apf-current.tar.gz 6. ls -la 看apf-xx是裝到哪裡0.9版的話應該是在目錄apf-0.9 7. cd apf-0.9 8. sh ./install.sh 9. cd /etc/apf 10.pico -w conf.apf In order for this firewall to work properly you have to edit/add/delete ports. These ports will allow services such as mail, ftp, and ssh to come in and out of the server. If you have changed any ports, please modify them below and add/remove as needed. # Common ingress (inbound) TCP ports IG_TCP_CPORTS="20,21,22,25,53,80,110,143,443,465, 993,995,2082,2083,2086,2087,2095,2096,3306, 10000,35000_35999" Please note that ports 2082 to port 2095 is mostly used by cpanel, and port 19638 is only use in ensim. # Common ingress (inbound) UDP ports IG_UDP_CPORTS="20,21,53,1040" 10.CTRL-X後輸入 Y存檔 11. 啟動apf使用 ./apf --start 或者service apf start 12. 確認正常,而且你沒被鎖在門外,繼續修改conf.apf 輸入 pico -w conf.apf 13. 設定 DEVM 參數為 0 DEVM="0" 14. CTRL-X離開,選 Y 存檔 15. 重新啟動apf service apf restart 1. To allow connections from xx.xx.xx.xx/24 Type: pico -w /etc/apf/allow_hosts.rules 2. At the very end of the file add this line xx.xx.xx.xx/24 Of course replace the xx.xx.xx.xx with the IP address provided to you |
#9
|
|||
|
|||
![]()
使用linux內建的工具來ban ip,至少有兩種,一個是 IPTable,一個是 xinetd(舊版linux通常使用 inetd)。
iptable 屬於核心層級的,無所不能卻難以掌控,一般而言,不是一兩條指令就可以周延。 xinted 比較像屬於應用程式階級的,比較好駕馭。 在設定檔中,有一條指令 no_access 可以把不想要的IP BAN掉。 使用google 搜尋一下,或是這一篇可以參考 http://www.iselong.com/5/915.htm (修改) 不過對於以 standalone 方式啟動的 daemon xinetd 就沒輒,只能個別在 standalone 啟動的daemon 設定檔中設定,不像 iptable 可以通殺! |
#10
|
|||
|
|||
![]()
哈拉大的主機有裝 iptables 嗎? --> lsmod | grep ip_tables
然後用 iptables -L -n | grep 61.175.128.31 看看有沒有出現類似, DROP all -- 61.175.128.31 0.0.0.0/0 DROP all -- 61.175.128.31 [主機 IP] |