本文介绍了即使在配置 Azure 入站规则和 Windows 防火墙之后,也无法在 Azure 上的 IIS FTP 服务器上列出目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  1. 我尝试使用 FileZilla FTP 客户端进行连接,但报同样的错误.

    状态:jothiprakashanandan.southindia.cloudapp.azure.com 的解析地址状态:连接到 104.211.244.241:21...状态:已建立连接,等待欢迎消息...状态:不安全的服务器,它不支持 FTP over TLS.状态:登录状态:正在检索目录列表...命令:密码响应:257/"是当前目录.命令:I型响应:200 类型设置为 I.命令:PASV错误:20 秒不活动后连接超时错误:无法检索目录列表状态:与服务器断开连接

  2. Azure的入站规则是这样的:

  3. VM 的防火墙入站规则.

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

解决方案

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

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

netsh advfirewall 设置全局 StatefulFtp 启用

然后重新启动 FTP windows 服务,我们应该可以正常运行了:

net stop ftpsvc网络启动 ftpsvc

这里有一个类似的

I'am running Windows Server 2012 in Azure, and I've configured the FTP server in IIS. When I try to connect the server, it accepts the username and password and log me in but not showing the directory listing.

  1. I've tried using FileZilla FTP client to connect and it saying the same error.

    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
    

  2. The inbound rule of Azure is this:

  3. The VM's firewall inbound rule.

  4. However when I try to login from the VM's browser it is working fine and showing the directory list.

解决方案

In Azure, we should deploy the passive mode FTP, we should add data channel ports range in FTP Firewall Support, then add those ports to NSG and windows firewall inbound rules.

By the way, although the windows firewall seems to allow all traffic that’s required, we also need to enable stateful FTP filtering on the firewall:

netsh advfirewall set global StatefulFtp enable

Then restart the FTP windows service and we should be up and running:

net stop ftpsvc
net start ftpsvc

Here is a similar case, same error as you, please refer to it.

Check which port does the FTP site listen on:

这篇关于即使在配置 Azure 入站规则和 Windows 防火墙之后,也无法在 Azure 上的 IIS FTP 服务器上列出目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 22:47