我正在尝试通过 Azure VM 的活动连接连接到远程 FTP 服务器。我收到的错误是
非法 PORT 命令。
我使用被动连接连接到其他 FTP 站点没有问题,但此 FTP 服务器仅支持主动连接。我的问题基本上与这个问题 https://serverfault.com/questions/401304/active-ftp-client-blocked-by-windows-firewall-on-windows-7,但我的问题不是由 Windows 防火墙引起的。我通过关闭防火墙几秒钟并重新尝试连接来验证这一点,但没有成功。
我的理论是,这与 Azure“端点”有关,尽管我无法验证这一点,而且我不知道如何设置它们以允许这样做。
有任何想法吗?
是的,这看起来像是缺少端点(+入站规则,如果您想启用防火墙)。
在主动模式下,服务器在特定端口上连接回客户端(由客户端传递,PORT 命令)-更长的解释 http://slacksite.com/other/ftp.html#actexample
为了在 azure 上使用主动模式,您必须:
Limit you FTP client to use specific port (or range) and public IP (it's on your VM's wallpaper)
e.g. FileZilla:
Every client should have this somewhere in options. Unless you are unlucky and using .NET Framework FTPWebRequest https://social.msdn.microsoft.com/forums/en-US/bc1e643a-75b4-4176-98c9-16d75daf6764/ftpwebrequest-specify-a-data-port-to-use.
Add endpoint with the same port (or range) in Endpoint settings http://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-set-up-endpoints/ of your Azure VM:
There is no way to add port range in one click you have to add every port one by one (quite annoying)
就是这样。您可以运行 FileZilla“网络连接向导”来验证这些设置,您应该看到如下内容:
Connecting to probe.filezilla-project.org
Response: 220 FZ router and firewall tester ready
USER FileZilla
Response: 331 Give any password.
PASS 3.9.0.6
Response: 230 logged on.
Checking for correct external IP address
IP 23.102.xx.xxx cd-bac-dd-bcg
Response: 200 OK
PREP 6000
Response: 200 Using port 6000, data token 1941533557
PORT 23,102,xx,xxx,23,112
Response: 200 PORT command successful
LIST
Response: 150 opening data connection
Response: 200 Successful
QUIT
Response: 200 goodbye!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)