简体   繁体   English

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

[英]Cannot list directory on IIS FTP server on Azure, even after configuring Azure inbound rules and Windows firewall

I'am running Windows Server 2012 in Azure, and I've configured the FTP server in IIS.我在 Azure 中运行 Windows Server 2012,并且在 IIS 中配置了 FTP 服务器。 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.我试过使用 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
  2. The inbound rule of Azure is this: Azure 的入站规则是这样的:

    Azure 入站规则

  3. The VM's firewall inbound rule. VM 的防火墙入站规则。虚拟机的入站规则

  4. However when I try to login from the VM's browser it is working fine and showing the directory list.但是,当我尝试从 VM 的浏览器登录时,它工作正常并显示目录列表。

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 .在 Azure 中,我们应该部署被动模式 FTP ,我们应该在FTP Firewall Support添加数据通道端口范围,然后将这些端口添加到NSGwindows 防火墙入站规则中。

在此处输入图像描述

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

netsh advfirewall set global StatefulFtp enable

Then restart the FTP windows service and we should be up and running:然后重新启动 FTP windows 服务,我们应该可以启动并运行:

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:检查 FTP 站点侦听的端口: 在此处输入图像描述

It is usually necessary to restart the Microsoft FTP service after enabling the FTP server rules in Windows firewall to have the change take an effect.在 Windows 防火墙中启用 FTP 服务器规则后,通常需要重新启动Microsoft FTP 服务才能使更改生效。

Or restarting a whole machine.或者重新启动整台机器。

See my guide to Installing an FTP Server on Windows using IIS .请参阅 的使用 IIS 在 Windows 上安装 FTP 服务器的指南。

The issue was with Azure network NSG.问题出在 Azure 网络 NSG 上。 you need to enable the port range on which data is getting transferred.您需要启用传输数据的端口范围。 数据连接端口范围

Added new rule in NSG to open this port range and it worked.在 NSG 中添加了新规则以打开此端口范围并且它有效。

The selected answer is good (passive mode FTP, IIS FTP Firewall Support, NSG, windows firewall).选择的答案很好(被动模式 FTP、IIS FTP 防火墙支持、NSG、windows 防火墙)。

However, I was missing inbound NAT rules on the load balancer.但是,我在负载均衡器上缺少入站 NAT 规则。

https://docs.microsoft.com/en-us/azure/load-balancer/manage-inbound-nat-rules?tabs=inbound-nat-rule-portal https://docs.microsoft.com/en-us/azure/load-balancer/manage-inbound-nat-rules?tabs=inbound-nat-rule-portal

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM