使用第三方FTP軟件filezilla進行登陸,出現如下錯誤:
狀態:?? ?正在連接 192.168.1.6:21...
狀態:?? ?連接建立,等待歡迎消息...
響應:?? ?220 (vsFTPd 2.2.2)
命令:?? ?USER ftp
響應:?? ?331 Please specify the password.
命令:?? ?PASS ***
響應:?? ?230 Login successful.
命令:?? ?SYST
響應:?? ?215 UNIX Type: L8
命令:?? ?FEAT
響應:?? ?211-Features:
響應:?? ? EPRT
響應:?? ? EPSV
響應:?? ? MDTM
響應:?? ? PASV
響應:?? ? REST STREAM
響應:?? ? SIZE
響應:?? ? TVFS
響應:?? ? UTF8
響應:?? ?211 End
命令:?? ?OPTS UTF8 ON
響應:?? ?200 Always in UTF8 mode.
狀態:?? ?已連接
狀態:?? ?讀取目錄列表...
命令:?? ?PWD
響應:?? ?257 "/"
命令:?? ?TYPE I
響應:?? ?200 Switching to Binary mode.
命令:?? ?PASV
響應:?? ?227 Entering Passive Mode (192,168,1,6,23,8).
命令:?? ?LIST
錯誤:?? ?連接超時
錯誤:?? ?讀取目錄列表失敗
該錯誤是由iptables的配置引起的,臨時的解決方法是執行如下命令:
[[email?protected] soft]# modprobe ip_nat_ftp
再次登陸列表正常啦!
但當你重新啟動服務器則iptables規則失效,又會出現相同的情況,所以我們需要修改/etc/sysconfig/iptables-config文件,
[[email?protected] soft]# vi /etc/sysconfig/iptables-config
# Load additional iptables modules (nat helpers)
#?? Default: -none-
# Space separated list of nat helpers (e.g. ‘ip_nat_ftp ip_nat_irc‘), which
# are loaded after the firewall rules are applied. Options for the helpers are
# stored in /etc/modprobe.conf.
IPTABLES_MODULES=""
# Unload modules on restart and stop
#?? Value: yes|no,? default: yes
# This option has to be ‘yes‘ to get to a sane state for a firewall
# restart or stop. Only set to ‘no‘ if there are problems unloading netfilter
# modules.
IPTABLES_MODULES_UNLOAD="yes"
......
IPTABLES_MODULES_UNLOAD="yes"的意義:每次iptables停止或者重啟都會Unload modules
IPTABLES_MODULES=""的意義:每次防火墻規則應用以后加載的模塊
我們需要把
IPTABLES_MODULES=""
修改為:
IPTABLES_MODULES="ip_nat_ftp"
這樣重啟服務器之后就不必再每次都執行mobprobe啦。
轉自: