Active FTP on Azure virtual machine
我在一台Azure Windows Server 2012虚拟机上的IIs8.0中安装了FTP。
在遵循了本文中的说明(http://itq.nl/walkthrough-hosting-ftp-on-iis-7-5-a-windows-azure-vm-2/)之后,我已经能够使ftp在被动模式下正常工作,但在从filezilla以主动模式连接时失败。ftp客户机可以在活动模式下连接到服务器,但在尝试执行list命令时失败,并显示超时错误消息。
我仔细修改了20和21个端点设置在AzureVM中,没有指向探测端口,并且Windows防火墙允许外部连接到20和21个VM端口。
我不明白为什么主动模式不能工作,而被动模式工作得很好。
我知道还有其他用户有问题。
是否有人在Azure VM中成功设置了活动ftp?.
以前的回答不正确。https://stackoverflow.com/a/20132312/5347085
我知道这一点是因为我广泛地与Azure支持部门合作。这个问题与服务器无法连接到客户机无关,我的测试方法有可能消除了客户机端的问题。
在与Azure支持部门合作了2周后,他们对问题的评估基本上是"活动模式ftp使用一系列大范围的随机端口作为从客户机到服务器的数据通道"。您只能将150个端点添加到一个Azure虚拟机,因此您不可能添加所有这些端口并使活动的FTP 100%工作。为了做到这一点,您需要使用"实例级公共IP",并基本上绕过所有端点机制,将您的虚拟机直接放在Internet上,完全依靠本机OS防火墙进行保护。
如果您必须在Azure上使用活动模式ftp,并且可以将您的虚拟机放在公共IP上,那么他提供了以下链接:
https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-instance-level-public-ip/
更新:来自Azure支持的官方响应:
Josh,
First of all thanks with your patience on this. As I mentioned in my
last email I was working with our Technical Advisors which are Support
Escalation Engineers on reproducing this environment in Azure. Our
tests were configured using WS_FTP 7.7 (Your version 7.1) and WS_FTP
12 client as well as the Windows FTP client. The results of our
testing were the same as you are experiencing. We were able to log in
to the server, but we get the same Command Port/List failures.As we discussed previously Active FTP uses a random port for the data
plane on the client side. The server connects via 21 and 20, but the
incoming port is a random ephemeral port. In Passive FTP, this can
be defined and therefore endpoints can be created for each port you
use for part of the data plane.Based on our extensive testing yesterday I would not expect any other Active FTP solution to work. The escalation Engineer that
assisted yesterday also discussed this with other members of his team
and they have not seen any successful Active FTP deployments in Azure.In conclusion, my initial thoughts have been confirmed with our
testing and Active FTP will not work in the Azure environment at
this time. We are always striving to improve Azure’s offering so
this may be something that will work in the future as we continue to
grow.You will need to move to a passive FTP setup if you are going to host
this FTP server in Azure.
当使用活动ftp时,客户端启动到ftp服务器上端口21的连接。这是命令或控制通道,通常连接成功。但是,ftp服务器随后尝试在客户机上打开端口20。这是数据通道。此通道用于所有数据传输,包括目录列表。
因此,在您的情况下,由于服务器无法启动与客户机的连接,所以活动FTP无法工作。这可能是服务器(出站防火墙规则)或客户端本身的问题。这通常是一件好事,因为您不希望基于Internet的服务器能够在客户机上打开连接。
在被动模式下,有一个明确的客户机/服务器区别,客户机启动到服务器的连接。建议使用被动模式,所以如果你能做到这一点,我会坚持下去。