vsftpd – 无法build立数据连接:EHOSTUNREACH – 没有路由到主机

我有一个VPS在CentOS 6.4上运行vsftpd v3.0.2。 当我尝试连接到我的FTP服务器,我得到的错误:

The data connection could not be established: EHOSTUNREACH - No route to host 

连接尝试的控制台:

 Status: Connecting to xxx.xxx.xxx.xxx:21... Status: Connection established, waiting for welcome message... Response: 220 snapd.server01 FTP Server Command: AUTH TLS Response: 234 Proceed with negotiation. Status: Initializing TLS... Status: Verifying certificate... Command: USER web01 Status: TLS/SSL connection established. Response: 331 Please specify the password. Command: PASS ********* Response: 230 Login successful. Command: OPTS UTF8 ON Response: 200 Always in UTF8 mode. Command: PBSZ 0 Response: 200 PBSZ set to 0. Command: PROT P Response: 200 PROT now Private. Status: Connected Status: Retrieving directory listing... Command: PWD Response: 257 "/" Command: TYPE I Response: 200 Switching to Binary mode. Command: PASV Response: 227 Entering Passive Mode (xxx,xxx,xxx,xxx,85,175). Command: LIST Error: The data connection could not be established: EHOSTUNREACH - No route to host 

我有所有需要的端口转发包括5000-5100。 我也尝试禁用SElinux – 没有工作。 用户web01 home dir设置为/var/www

我研究了互联网。 有人说,在vsftpd.conf中如果有空格,会导致错误,但事实并非如此。

看起来像active/passive模式问题。 似乎你使用Passive模式。

我会尝试Active模式。

如果你真的想Passive模式,我怀疑你没有打开所有需要的端口( from TCP/1024 to TCP/65534 )。

请注意,您可以使用vsftpd.conf pasv_min_portpasv_max_port指令来限制被动模式的端口范围。

服务器的NAT?

 vi /etc/sysconfig/iptables-config IPTABLES_MODULES="ip_nat_ftp"