即使配置了 Azure 入站规则和 Windows 防火墙,也无法列出 Azure 上 IIS FTP 服务器上的目录

Jot*_*dan 4 iis ftp azure azure-virtual-machine

我在 Azure 中运行 Windows Server 2012,并在 IIS 中配置了 FTP 服务器。当我尝试连接服务器时,它接受用户名和密码并让我登录,但不显示目录列表。

  1. 我试过使用 FileZilla FTP 客户端进行连接,但它说同样的错误。

    Status: Resolving address of jothiprakashanandan.southindia.cloudapp.azure.com
    Status: Connecting to 104.211.244.241:21...
    Status: Connection established, waiting for welcome message...
    Status: Insecure server, it does not support FTP over TLS.
    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
    Error:  Connection timed out after 20 seconds of inactivity
    Error:  Failed to retrieve directory listing
    Status: Disconnected from server
    
    Run Code Online (Sandbox Code Playgroud)
  2. Azure的入站规则是这样的:

    Azure 入站规则

  3. VM 的防火墙入站规则。 虚拟机的入站规则

  4. 但是,当我尝试从 VM 的浏览器登录时,它工作正常并显示目录列表。

Jas*_* Ye 8

在 Azure 中,我们应该部署被动模式 FTP,我们应该在FTP 防火墙支持中添加数据通道端口范围,然后将这些端口添加到NSGwindows 防火墙入站规则

在此处输入图片说明

顺便说一下,虽然 windows 防火墙似乎允许所有需要的流量,但我们还需要在防火墙上启用有状态的 FTP 过滤:

netsh advfirewall set global StatefulFtp enable
Run Code Online (Sandbox Code Playgroud)

然后重新启动 FTP windows 服务,我们应该启动并运行:

net stop ftpsvc
net start ftpsvc
Run Code Online (Sandbox Code Playgroud)

这是一个类似的案例,和你一样的错误,请参考。

检查 FTP 站点侦听的端口: 在此处输入图片说明