Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

FTP 伺服器 iptables 設定:主動模式與被動模式

vsftpd 加上 iptables 後,若只放行 21 埠,主動模式可能可連,但被動模式常失敗。因為被動模式會使用高位埠,防火牆未放行就會中斷。

FTP 伺服器 iptables 設定:主動模式與被動模式 FTP 伺服器 iptables 設定:主動模式與被動模式

把用戶端改為主動模式,通常可連線。

FTP 伺服器 iptables 設定:主動模式與被動模式 FTP 伺服器 iptables 設定:主動模式與被動模式

若要允許被動模式,可載入 nf_conntrack_ftp 模組,讓 Netfilter 把 FTP 資料連線標記為 RELATED。

FTP 伺服器 iptables 設定:主動模式與被動模式 FTP 伺服器 iptables 設定:主動模式與被動模式 FTP 伺服器 iptables 設定:主動模式與被動模式

另一個方法是在 vsftpd 設定 pasv_min_port 與 pasv_max_port,限定被動埠範圍,再到 iptables 放行該範圍。

Copyright © Linux教程網 All Rights Reserved