【问题标题】:FileZilla - "The data connection could not be established: ECONNREFUSED - Connection refused by server" when retrieving directory listingFileZilla - 检索目录列表时“无法建立数据连接:ECONNREFUSED - 服务器拒绝连接”
【发布时间】:2017-10-01 04:46:06
【问题描述】:

所以几天前,我尝试创建一个家庭 FTP 服务器,我可以从自己的网络访问它。有效。但现在我想更进一步。我希望通过外部 IPv4 地址从任何网络访问我的家庭 FTP 服务器。所以这是我的问题。

每次如果我想在localhost 或我的本地 IP 地址上连接到我的服务器,它就可以工作。但是当我尝试使用我的外部 IP 地址上的相同凭据进行连接时,它说它无法检索目录列表:

Status: Connecting to *************:800...
Status: Connection established, waiting for welcome message...
Status: Logged in
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is current directory.
Command:    TYPE I
Response:   200 Type set to I
Command:    PASV
Response:   227 Entering Passive Mode (**,***,*,***,***,106)
Command:    MLSD
Error:  The data connection could not be established: ECONNREFUSED - Connection refused by server
Response:   425 Can't open data connection for transfer of "/"
Error:  Failed to retrieve directory listing

227 响应中的(混淆)IP 地址与“正在连接到...”消息中的(混淆)服务器 IP 地址不匹配。

我尝试关闭防火墙,为 TCP 和 UDP 转发端口 21 和端口 800,但没有任何效果。我还为这两个端口设置了例外,但效果并不好。

另一个问题是,如果我想在我的 FileZilla 服务器上登录我的外部 IP 地址,它会显示:

正在连接到服务器 -censored-:14147...

错误,无法连接到服务器

尝试在 5 秒后重新连接

我的问题是:如何创建一个可以远程访问的家庭 FTP 服务器?

【问题讨论】:

    标签: networking ftp firewall filezilla


    【解决方案1】:
    Response:   227 Entering Passive Mode (**,***,*,***,***,106)
    Command:    MLSD
    Error:  The data connection could not be established: ECONNREFUSED - Connection refused by server
    

    如果227PASV命令的响应中的IP地址与实际的FTP服务器IP地址不匹配,则服务器配置错误。

    这通常发生在服务器不知道其外部 IP 地址并报告其内部 IP 地址时。但大多数 FTP 客户端(包括 FileZilla)都能够通过检查 IP 地址与为专用网络中的本地通信保留的一系列地址来检测到这一点。见Server sent passive reply with unroutable address in FileZilla。由于没有发生这种情况,服务器可能显式配置了错误的 IP 地址。

    有关一般信息,请参阅我的article about network configuration needed for FTP

    您必须将 FTP 服务器重新配置为新的 IP 地址。在 FileZilla FTP 服务器中,您可以通过在 FileZilla 服务器界面中转到 编辑 > 设置 > 被动模式设置 > IPv4 特定 > 用于被动传输的外部服务器 IP 地址 来做到这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-10
      • 2014-08-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多