无法连接到 FTP 服务器:425 无法建立数据连接:连接超时

无法连接到 FTP 服务器:425 无法建立数据连接:连接超时

我的笔记本电脑上安装了 Windows 7。我安装了 VirtualBox 4.1.4 和 Ubuntu 11.10。

我正在尝试通过 FTP 连接到我的网站,但是出现错误ls

~> ftp <my_site>
Connected to <my_site>.
220 DreamHost FTP Server
Name (<my_site>:misha): <my_username>
331 Password required for <my_username>
Password: <my_password>
230 User <my_username> logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful
425 Unable to build data connection: Connection timed out
ftp> 

可能是什么问题呢?

答案1

连接正在建立但无法设置返回数据路径。

这可能是因为路径中的某些东西不支持来自源(可能是边界路由器)的 PORT 模式 ftp。

尝试使用ftp -p以被动(PASV)模式启动客户端。

答案2

您的服务器在哪里,是本地的吗?如果不是,
在活动 FTP 中,您会遇到 NAT 转换问题,因为连接端口是固定端口 21,但数据端口可能会在 1024 以上变化,这是由于来自池 FTP 应用程序的 NAT 无法建立数据连接。

如果您使用 Windows ftp.exe,它不支持被动 FTP 模式,因此 PASV 命令将不起作用。只有 ubuntu/unix 操作系统支持被动 FTP,此时服务器将启动数据端口,并要求远程通过该端口进行连接。

作为您的服务提供商的 /30 公共 IP 问题将会解决。

相关内容