鳥哥的 Linux 私房菜-新手討論區

特別適合 Linux 新手的討論區
鳥哥的 Linux 私房菜首頁 | 鳥哥 / Study Area 主站特搜 | Study Area | 酷!學園 討論區
新手發文時必看之:鳥園的文章管理規則提問的智慧, 簡繁體轉換的問題
現在的時間是 2010-09-08 18:52

所有顯示的時間為 UTC + 8 小時




發表新文章 回覆主題  [ 15 篇文章 ] 
發表人 內容
 文章主題 :
文章發表於 : 2004-12-30 08:40 
離線
鳥友板主群
鳥友板主群

註冊時間: 2002-08-22 09:54
文章: 7904
來自: 宇宙銀河系獵戶星座太陽系地球台灣
哇! 真是太棒了!!


但,能不能額外要求,請您排版一下,好方便讀者閱讀呢?

_________________
文章管理相關規定,請詳閱.
如有任何疑問或爭議,請用私人訊息功能跟小弟聯繫.
習慣打錯字的小白不可憐, 把這邊當成廠商客服喊救命的也不可憐.
別用私人訊息來發問題,請到討論版上發問
-------
半神半聖亦半仙,允文允武亦全嫌;腦中藏書沒半卷,期盼工作有閒錢!
無事輕狂不問天,風風雨雨愁華年;問君過往幾多事,撫箏彈曲流水間.
折扇搖曳生風姿,長袖揮舞展媚態;紅顏知己有幾人,濁酒一壺渡眾生.


回頂端
 個人資料  
 
 文章主題 :
文章發表於 : 2004-12-30 09:03 
離線
鳥友板主群
鳥友板主群

註冊時間: 2002-08-22 09:54
文章: 7904
來自: 宇宙銀河系獵戶星座太陽系地球台灣
這樣子不曉得有沒有好一點? :roll:

_________________
文章管理相關規定,請詳閱.
如有任何疑問或爭議,請用私人訊息功能跟小弟聯繫.
習慣打錯字的小白不可憐, 把這邊當成廠商客服喊救命的也不可憐.
別用私人訊息來發問題,請到討論版上發問
-------
半神半聖亦半仙,允文允武亦全嫌;腦中藏書沒半卷,期盼工作有閒錢!
無事輕狂不問天,風風雨雨愁華年;問君過往幾多事,撫箏彈曲流水間.
折扇搖曳生風姿,長袖揮舞展媚態;紅顏知己有幾人,濁酒一壺渡眾生.


回頂端
 個人資料  
 
 文章主題 :
文章發表於 : 2004-12-31 01:49 
離線
鳥友板主群
鳥友板主群

註冊時間: 2003-06-29 11:45
文章: 6568
來自: 台北新店
替您拍拍手^^

_________________
提問的智慧
看不懂英文時多用用英文字典


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2009-12-14 09:29 
離線
初來乍到小菜鳥
初來乍到小菜鳥

註冊時間: 2007-02-03 05:01
文章: 17
第 1 頁 (共 1 頁) [ 6 篇文章 ]
但為什麼只能看到 3 篇文章??


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2009-12-14 09:43 
離線
鳥友板主群
鳥友板主群

註冊時間: 2002-08-22 09:54
文章: 7904
來自: 宇宙銀河系獵戶星座太陽系地球台灣
可能是原作者的名字變成亂碼被系統自動砍掉,所以相關的文章內容也消失了吧 U_U

_________________
文章管理相關規定,請詳閱.
如有任何疑問或爭議,請用私人訊息功能跟小弟聯繫.
習慣打錯字的小白不可憐, 把這邊當成廠商客服喊救命的也不可憐.
別用私人訊息來發問題,請到討論版上發問
-------
半神半聖亦半仙,允文允武亦全嫌;腦中藏書沒半卷,期盼工作有閒錢!
無事輕狂不問天,風風雨雨愁華年;問君過往幾多事,撫箏彈曲流水間.
折扇搖曳生風姿,長袖揮舞展媚態;紅顏知己有幾人,濁酒一壺渡眾生.


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2009-12-14 12:26 
離線
站長鳥哥
站長鳥哥

註冊時間: 2002-06-09 23:45
文章: 8466
來自: 南台灣
真是要命啊!傷腦筋了!怎麼會這樣~
老實說,救不回來這資料....

_________________
解決問題的順序:
1. 先查閱硬體(有沒有超頻/記憶體模組/周邊網路設備的好壞等等);
2. 檢查 /var/log 底下的登錄檔,尤其是 /var/log/messages 的內容;
3. 不要急,先翻書瞭解相關問題的原理,再設法解決~
4. 利用關鍵字,在 www.google.com.tw 查閱是否有人已經遇過類似的問題?
5. 都沒有辦法了,再在討論區以明確的標題以及重要的資訊貼成內文來發問啦!


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2009-12-15 23:19 
離線
完全無畏的老鳥
完全無畏的老鳥

註冊時間: 2002-11-22 09:51
文章: 468
來自: 台北
原來如此~ 難怪有些文章看起來沒頭沒尾的@@
鳥哥辛苦啦!

_________________
~~ Linux 菜比巴 ~~


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2010-06-18 09:54 
離線
初窺門徑的菜鳥
初窺門徑的菜鳥

註冊時間: 2010-06-01 22:39
文章: 50
可以請再重發一次嗎?或是沒內容了,可否不要置頂了?


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2010-07-04 14:12 
離線
初窺門徑的菜鳥
初窺門徑的菜鳥

註冊時間: 2005-01-01 20:59
文章: 57
來自: 在世界中心呼喊愛情
這一篇文章 我沒記錯的話 我當初是參照某篇網路上的文章去改寫的
我再找找把我的code貼上來
或許 我寫得不好 但是 我達到了我想要功能拉

_________________
---

玩linux就像一種藥癮
簡單說 我就是在吸毒


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2010-07-04 14:39 
離線
初窺門徑的菜鳥
初窺門徑的菜鳥

註冊時間: 2005-01-01 20:59
文章: 57
來自: 在世界中心呼喊愛情
1. 首先 建立一個script, sshd_httpd.sh 在 /usr/local/virus/iptables
代碼:
#!/bin/sh
# 2005/01/15 ver4  by Boolean@HC Email:boolean@xx
# 2009/10/06 ver5  by Boolean Email:boolean@boolean.twbbs.org
#
# 檔案存放的路徑
basedir="/usr/local/virus/iptables"

# log 存放的地方
sshlog="/var/log/secure"
httplog="/var/log/httpd/error_log"

# mail for
mailfor="boolean"

# 登入錯誤訊息
faildMsg="sshd.*Failed password"
faildMsgInvalid="sshd.*Failed password for invalid user"

# 登入幾次失敗 就擋掉
loginCountFail=3

#定義白名單. 現在已從sshd抓到的block名單,目前firewall的抵擋名單
nodenyip="$basedir/wip.txt"
sshd_block="$basedir/sshd_block_ip_now"
httpd_block="$basedir/httpd_block_ip_now"
block_ip="$basedir/block_ip"
tmp_sshd="/tmp/sshd"
tmp_httpd="/tmp/httpd"
denyfile="$basedir/iptables.deny"

#先抓sshd錯誤IP,灌入block名單
cat "$sshlog" | grep "sshd.*Failed password for" | grep -v "invalid" > /tmp/ssh_tmp.log
cat "$sshlog" | grep "sshd.*Failed password for invalid user" > /tmp/ssh_tmp2.log
cat "$httplog" | grep "File does not exist:" > /tmp/httpd_tmp.log
cat /tmp/httpd_tmp.log | cut -d " " -f8 | cut -d "]" -f1 > $tmp_httpd
cat /tmp/ssh_tmp.log | cut -d " " -f11 > $tmp_sshd
cat /tmp/ssh_tmp.log | cut -d " " -f12 >> $tmp_sshd
cat /tmp/ssh_tmp2.log | cut -d " " -f14 >> $tmp_sshd

#順便抓取 secure.1 ,
declare -i lognumber=1
for (( m=1 ; m<=$lognumber ; m=m+1 ));
do
     if [ -f "$sshlog.$m" ]; then
      cat "$sshlog.$m" | grep "sshd.*Failed password for" | grep -v "invalid" >> /tmp/ssh_tmp.log
      cat "$sshlog.$m" | grep "sshd.*Failed password for invalid user" >> /tmp/ssh_tmp2.log
      cat /tmp/ssh_tmp.log | cut -d " " -f11 >> $tmp_sshd
      cat /tmp/ssh_tmp.log | cut -d " " -f12 >> $tmp_sshd
      cat /tmp/ssh_tmp2.log | cut -d " " -f14 >> $tmp_sshd
     else
      echo "檔案 $sshlog.$m 並不存在 !!!!"
     fi
    if [ -f "$httplog.$m" ]; then
      cat "$httplog.$m" | grep "File does not exist:" >> /tmp/httpd_tmp.log
       cat /tmp/httpd_tmp.log | cut -d " " -f8 | cut -d "]" -f1 >> $tmp_httpd
    else
      echo "檔案 $httplog.$m 並不存在 !!!!"
     fi

done

#SSHD section:利用for 迴圈去跑 drop ip , if 失敗次數小於3次
number_sshd=`cat $tmp_sshd | sort | uniq`
for ip in $number_sshd ;
do
  # 計算此IP登入幾次失敗
  count=`cat $tmp_sshd | grep "$ip" | wc -l`
  # 如果登入失敗次數大於 預設值 則執行  drop
    if [ "$count" -gt "$loginCountFail" ] ; then
       touch "$sshd_block"
       echo "$ip" >> "$sshd_block"
    fi
done

#HTTPD section:利用for 迴圈去跑 drop ip , if 失敗次數小於3次
number_httpd=`cat $tmp_httpd | sort | uniq`
for ip in $number_httpd ;
do
  # 計算此IP登入幾次失敗
  count=`cat $tmp_httpd | grep "$ip" | wc -l`
  # 如果登入失敗次數大於 預設值 則執行  drop
    if [ "$count" -gt "$loginCountFail" ] ; then
       touch "$httpd_block"
       echo "$ip" >> "$httpd_block"
    fi
done

#抓取目前已抵擋名單
if [ -f "$denyfile" ];then
   cat $denyfile | cut -d " " -f 7 >> $block_ip
   rm -rf $denyfile
  else
   echo "不存在 $denyfile ,Script會依需要自動建立"
fi
cat $sshd_block | sort | uniq > /tmp/ip
cat $httpd_block | sort | uniq >> /tmp/ip
cat $block_ip | sort | uniq >> /tmp/ip
cat /tmp/ip | sort | uniq > $block_ip
target=`cat $block_ip`
if [ "$target" = "" ]; then
   echo "目前沒有添加需要被阻擋IP的需要"
else
for i in $target ;
do
target1=`cat $nodenyip | grep $i`
   if [ "$target1" = "" ]; then
      if [ -f "$denyfile" ]; then
      echo "/sbin/iptables -A INPUT -i "'$EXTIF'" -s $i -j DROP #auto" >> $denyfile
      else
      echo "/sbin/iptables -A INPUT -i "'$EXTIF'" -s $i -j DROP #auto" > $denyfile
      fi
      echo "<<添加>>IP: $i Add to $denyfile"
    else
     echo "<<去除>>According to the $nodenyip ,drop the IP: $i"
    fi
done
fi
cat $denyfile | sort | uniq > $denyfile
rm -rf $tmp_sshd
rm -rf $tmp_httpd
rm -rf /tmp/ssh*
rm -rf /tmp/http*
./iptables.rule



2.接下來,就是Copy鳥哥的scripts, 去建立 iptables.rule 在 /usr/local/virus/iptables
代碼:
#!/bin/bash
#
# ========================================================
# 程式說明:
# 歡迎使用 iptables.rule 這個 script 來建立您的防火牆!
# 這支 script 還需要您的額外設定方可適合您的主機環境!
# 基本規則定義為『拒絕所有,開放特定』的模式!
#
# 強烈建議:
# 不了解 Linux 防火牆機制 iptables 的朋友使用這支 script
# 可能會不太瞭解每個指令列的意義,果真如此的話,
# 歡迎參考底下幾個網頁:
# http://www.study-area.org/linux/servers/linux_nat.htm
# http://linux.vbird.org/linux_server/0240network-secure-1.php
# http://linux.vbird.org/linux_server/0250simple_firewall.php
#
# 使用說明:
# 確定這個程式僅有 Linux 的斷行字元:
#       dos2unix iptables.rule
# 請先將這個 scripts 的權限更改為可執行:
#       chmod 755 iptables.rule
# 在將這個程式放置在 /usr/local/virus/iptables 目錄下:
#       mkdir -p /usr/local/virus/iptables
#       mv /完整的路徑/iptables.rule /usr/local/virus/iptables
# 執行測試:
#       /usr/local/virus/iptables/iptables.rule
#       iptables -L -n   (這個動作在檢查防火牆規則)
# 將底下這一行加入 /etc/rc.d/rc.local 當中
#       /usr/local/virus/iptables/iptables.rule
# 取消防火牆:
#       iptables -F
#       iptables -X
#       iptables -t nat -F
#       iptables -t nat -X
#
# ========================================================
# 版權宣告:
# 這支程式為 GPL 授權,任何人皆可使用,
# 然,若使用本 scripts 發生問題時,本人不負任何責任
# VBird <vbird@mail.vbird.idv.tw>
# ========================================================
#
# 歷史紀錄:
# 2002/08/20    VBird   首次釋出
# 2003/04/26    VBird   加入砍站軟體的相關執行檔案!
# 2003/08/25    VBird   修改 INPUT 的 Policy 成為 DROP
# 2006/09/13    VBird   重新修訂,加入一些核心參數 /proc/sys/net/ipv4/*
# 2006/09/15    VBird   加入關於 NAT 主機後端伺服器的轉址功能。
# 2006/09/30    VBird   加入每個設定項目的英文說明!!
# 2006/11/08    VBird   參考朋友們發現的 PPPoE 導致 MTU 的問題,增加一條規則!在 NAT 的部分。
#
###########################################################################################

# 請先輸入您的相關參數,不要輸入錯誤了!
# English: Please input your networks parameters ( including your LAN NIC )
  EXTIF="eth0"                          # 這個是可以連上 Public IP 的網路介面,也可能是 ppp0
                                        # This is your NIC, connect to internet. Such as ppp0...
  INIF=""                               # 內部 LAN 的連接介面;若無 LAN ,填寫成 INIF=""
                                        # This is your LAN NIC.  If you don't have a LAN, input INIF="" please.
  INNET="192.168.1.0/24"      # 若有兩個以上的網域,可以用 INNET="192.168.1.0/24 192.168.100.0/24"
                                        # 若無內部網域介面,請填寫成 INNET=""
                                        # This is your LAN's Network.  If you have to private network,
                                        # input as INNET="192.168.1.0/24 192.168.100.0/24".
  export EXTIF INIF INNET

# 個人化設定啊!請自行填寫您自己想要預先啟動的一些基礎資料。
# These settings is about yourself's paramters.
  allowname='no.bbs.org'                 # 允許登入本機的 hostname ,必須是 Internet 找的到的 hostname。
  allowip=""
  if [ "$allowname" != "" ]; then
    for siteiptmp in `echo $allowname`
    do
          siteip=`/usr/bin/host $siteiptmp 168.95.1.1    | grep address|tail -n 1 | awk '{print $4}'`
          testip=`echo $siteip | grep [^0-9.]`
          if [ "$testip" == "" ]; then
               allowip="$allowip  $siteip"
          fi
    done
  fi
  export allowip

# 第一部份,針對本機的防火牆設定!#########################################################
# First, your server's firewall settings.
# 1. 先設定好核心的網路功能:
# 1. the kernel's firewall settings.
  # 開啟 TCP Flooding 的 DoS 攻擊抵擋機制,但這個設定不適合 loading 已經很高的主機!!!
  # TCP Flooding's setting.  this setting is no good for high loading servers
  echo "1" > /proc/sys/net/ipv4/tcp_syncookies
  # 取消 ping 廣播的回應;
  # unset reply of ping.
  echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
  # 開啟逆向路徑過濾,以符合 IP 封包與網路介面的設定;
  #
  for i in /proc/sys/net/ipv4/conf/*/rp_filter; do
        echo "1" > $i
  done
  # 開啟記錄有問題的封包
  # record some problems packets.
  for i in /proc/sys/net/ipv4/conf/*/log_martians; do
        echo "1" > $i
  done
  # 取消來源路由,這個設定值是可以取消的;
  for i in /proc/sys/net/ipv4/conf/*/accept_source_route; do
        echo "0" > $i
  done
  # 取消重新宣告路徑的功能。
  for i in /proc/sys/net/ipv4/conf/*/accept_redirects; do
        echo "0" > $i
  done
  # 取消傳送重新宣告路徑的功能。
  for i in /proc/sys/net/ipv4/conf/*/send_redirects; do
        echo "0" > $i
  done

# 2. 清除規則、設定預設政策及開放 lo 與相關的設定值
# 2. clear rule, set the policy rule and allow lo connect.
  PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin; export PATH
  iptables -F
  iptables -X
  iptables -Z
  iptables -P INPUT   DROP
  iptables -P OUTPUT  ACCEPT
  iptables -P FORWARD ACCEPT
  iptables -A INPUT -i lo -j ACCEPT
  iptables -A INPUT -m state --state RELATED -j ACCEPT
# 3. 啟動額外的防火牆 script 模組
# 3. other shell scripts, written by VBird.
  # 預設抵擋的主機
  if [ -f /usr/local/virus/iptables/iptables.deny ]; then
        sh /usr/local/virus/iptables/iptables.deny
  fi
  # 預設開放的主機
  if [ -f /usr/local/virus/iptables/iptables.allow ]; then
        sh /usr/local/virus/iptables/iptables.allow
  fi
  # 透過 WWW 砍站軟體分析的抵擋機制
  if [ -f /usr/local/virus/httpd-err/iptables.http ]; then
        sh /usr/local/virus/httpd-err/iptables.http
  fi
  iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT

# 4. 允許某些類型的 ICMP 封包進入
# 4. allow some types of ICMP
  AICMP="0 3 3/4 4 11 12 14 16 18"
  for tyicmp in $AICMP
  do
        iptables -A INPUT -i $EXTIF -p icmp --icmp-type $tyicmp -j ACCEPT
  done

# 5. 允許某些服務的進入
iptables -A INPUT -p TCP -i $EXTIF --dport  22  -j ACCEPT      # SSH
iptables -A INPUT -p TCP -i $EXTIF --dport  25  -j ACCEPT      # SMTP
# iptables -A INPUT -p UDP -i $EXTIF --dport  161  -j ACCEPT    # SNMP-MRTG
# iptables -A INPUT -p TCP -i $EXTIF --dport  53  -j ACCEPT     # DNS
iptables -A INPUT -p TCP -i $EXTIF --dport  80  -j ACCEPT      # WWW
# iptables -A INPUT -p TCP -i $EXTIF --dport 110  -j ACCEPT     # POP3
iptables -A INPUT -p TCP -i $EXTIF --dport 443  -j ACCEPT      # HTTPS
iptables -A INPUT -p TCP -i $EXTIF --dport 3128  -j ACCEPT     # Squid
iptables -A INPUT -p TCP -i $EXTIF --dport 5900  -j ACCEPT     # VNC

# 第二部份,針對後端主機的防火牆設定!#########################################################
# Second, the NAT settings.
# 1. 先載入一些有用的模組
# 1. loading some good modules of iptables.
  modules="ip_tables iptable_nat ip_nat_ftp ip_nat_irc ip_conntrack ip_conntrack_ftp ip_conntrack_irc"
  for mod in $modules
  do
        testmod=`lsmod | grep "^${mod} " | awk '{print $1}'`
        if [ "$testmod" == "" ]; then
                modprobe $mod
        fi
  done

# 2. 清除 NAT table 的規則吧!
# 2. clean NAT table's rule
  iptables -F -t nat
  iptables -X -t nat
  iptables -Z -t nat
  iptables -t nat -P PREROUTING  ACCEPT
  iptables -t nat -P POSTROUTING ACCEPT
  iptables -t nat -P OUTPUT      ACCEPT

# 3. 開放成為路由器,且為 IP 分享器!
# 3. NAT server's settings
  if [ "$INIF" != "" ]; then
        iptables -A INPUT -i $INIF -j ACCEPT
        echo "1" > /proc/sys/net/ipv4/ip_forward
        if [ "$INNET" != "" ]; then
                for innet in $INNET
                do
                        iptables -t nat -A POSTROUTING -s $innet -o $EXTIF -j MASQUERADE
                done
        fi
  fi
  # 如果你的 MSN 一直無法連線,或者是某些網站 OK 某些網站不 OK,可能是 MTU 的問題,
  # 那你可以將底下這一行給他取消註解來啟動 MTU 限制範圍
  # iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --clamp-mss-to-pmtu

# 4. NAT 主機後端的 LAN 內對外之伺服器設定
# iptables -t nat -A PREROUTING -p tcp -i $EXTIF --dport 80 -j DNAT --to 192.168.1.210:80 # WWW



3.可預先建立 wip.txt 白名單在 /usr/local/virus/iptables,免得擋到自己
例如 vi wip.txt
代碼:
127.0.0.1
192.168.1.123
192.168.1.111


4.建立 iptables.allow 和 iptables.deny (follow 鳥哥的scripts..注意看第二項)
vi iptables.allow
代碼:
#!/bin/bash
# 底下則填寫你允許進入本機的其他網域或主機啊!
#  iptables -A INPUT -i $EXTIF -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -i $EXTIF -p TCP -s 192.168.1.0/24 --dport 1234 -j ACCEPT

vi iptables.deny
代碼:
/sbin/iptables -A INPUT -i $EXTIF -s 110.172.24.28 -j DROP #auto
/sbin/iptables -A INPUT -i $EXTIF -s 111.118.160.201 -j DROP #auto
/sbin/iptables -A INPUT -i $EXTIF -s 112.125.60.81 -j DROP #auto
/sbin/iptables -A INPUT -i $EXTIF -s 112.179.62.17 -j DROP #auto
/sbin/iptables -A INPUT -i $EXTIF -s 112.216.83.178 -j DROP #auto
/sbin/iptables -A INPUT -i $EXTIF -s 113.105.131.130 -j DROP #auto
/sbin/iptables -A INPUT -i $EXTIF -s 113.11.203.98 -j DROP #auto
# 請follow 這個格式去做
# 有auto的部分,是成是自動加入的


5. 寫入 crontab中,定時執行
vi /etc/crontab
代碼:
#伺服器sshd&httpd安全
*/1 * * * * root /usr/local/virus/iptables/sshd_httpd.sh > /dev/null 2>&1

_________________
---

玩linux就像一種藥癮
簡單說 我就是在吸毒


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2010-07-04 14:45 
離線
初窺門徑的菜鳥
初窺門徑的菜鳥

註冊時間: 2005-01-01 20:59
文章: 57
來自: 在世界中心呼喊愛情
因為我只是看前輩文章,所以,改出來的東西,不保證沒有bug拉! (我有實際應用在我系統上,沒問題)
我知道程式很冗長,所以,有興趣的高手再幫忙改寫吧!
我只是想傳達理念拉!已經很久沒有時間碰Linux
所以,獻醜了~

PS:我後來改版的時候,把FTP的部分拿掉了,其實理念都一樣,有需要的人再加回去就好了

_________________
---

玩linux就像一種藥癮
簡單說 我就是在吸毒


回頂端
 個人資料  
 
 文章主題 : Re: [分享]自動Ban IP ==阻擋非信任ip try SSH & FTP 的script
文章發表於 : 2010-09-01 16:38 
離線
初來乍到小菜鳥
初來乍到小菜鳥

註冊時間: 2010-09-01 16:28
文章: 1
Boolean您好~
這個自動BAN IP的Script對我的幫助真的很大,謝謝你!

關於這個Script有個小地方想跟大家討論
就是Script的最後一行:
./iptables.rule
不知道是不是改成這樣會比較理想:
$basedir/iptables.rule

照原本的寫法,我必須把路徑切換到"/usr/local/virus/iptables"才能正常執行這個Script,改成這種寫法就沒這個限制了。
還是說這種寫法會造成其他問題,還有其他需要考慮的地方呢?


回頂端
 個人資料  
 
顯示文章 :  排序  
發表新文章 回覆主題  [ 15 篇文章 ] 

所有顯示的時間為 UTC + 8 小時


誰在線上

正在瀏覽這個版面的使用者:EMILYKEKE 和 6 位訪客


不能 在這個版面發表主題
不能 在這個版面回覆主題
不能 在這個版面編輯您的文章
不能 在這個版面刪除您的文章

搜尋:
前往 :  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
正體中文語系由 竹貓星球 維護製作