【发布时间】:2013-09-13 20:31:23
【问题描述】:
我正在努力连接到 Azure 中新 VM 上的 FTP。
我从默认映像(Windows Server 2012 Datacenter)创建了一个新的虚拟机,并将 RDP 插入到新的 VM 中。然后,我启用了 Web 服务器 (IIS) 角色,包括 FTP 服务器,并使用 Web 平台安装程序中的推荐设置配置了 IIS。然后我使用 IIS 管理器“添加 FTP 站点...”向导添加一个具有根 %systemdrive%\inetpub\ftproot 的 FTP 站点,并将 ftp 站点设置为启用匿名身份验证,允许匿名用户读取访问权限,提供数据通道端口范围 7000- 7014,并从 Azure 管理门户中的 VM 仪表板将防火墙的外部 IP 地址指定为公共虚拟 IP (VIP) 地址。
防火墙也配置为允许 FTP 服务器。
此时 FTP 服务正在运行。我知道,因为如果我在 RDP 会话中打开虚拟机上的命令提示符,我会得到以下信息
C:\Users\slife>ftp 127.0.0.1
Connected to 127.0.0.1.
220 Microsoft FTP Service
User (127.0.0.1:(none)): ftp
331 Anonymous access allowed, send identity (e-mail name) as password.
Password:
230 User logged in.
ftp>
但是我无法从其他地方连接。
C:\Users\timregan>ftp 111.111.111.33
Connected to 111.111.111.33.
Connection closed by remote host.
这是我从 FileZilla 中的命令提示符得到的
Status: Connecting to 111.111.111.33:21...
Status: Connection established, waiting for welcome message...
Error: Could not connect to server
我遵循了门罗纳德的Walkthrough: Hosting FTP on IIS 7.5 in a Windows Azure VM 并添加了两个端点以允许访问端口 21(FTP 命令端口)和 20(FTP 数据端口),并且我使用了他的 Azure Powershell 建议来添加被动端口端点,例如
Get-AzureVM -ServiceName 'blah' -Name 'blah' | Add-AzureEndpoint -Name 'FTPPassive00' -Protocol 'TCP' -LocalPort 7000 -PublicPort 7000 | Update-AzureVM
然后我可以在 VM 的 Azure 管理端点列表中看到。
为什么我的连接无法从外部连接到 IIS 中的 FTP 服务器?如何诊断故障?
========== 编辑 1 ==========
我想知道the solution that worked for haxor 是否可以解决问题。这引用了 Windows Azure 虚拟机论坛上对“Server 2012 VM on Azure - Passive FTP Won't Work”的答案,该论坛指出,如果 Azure 门户在被动端点上配置了探测,那么它们可能无法工作。尽管答案指出这在最新版本的门户中已修复,但它建议使用 Azure Powershell cmdlet Add-AzureEndpoint 来确保不启动任何探测。我检查了 Azure Powershell cmdlet Get-AzureEndpoint,我的 ftp 端点都没有探测,所以这不是我的问题。
========== 编辑2 ==========
我注意到Passive FTP and dynamic ports in IIS8 and Windows Azure Virtual Machines 中未提及the original walkthrough 中的一个步骤:在Windows 防火墙中打开数据通道端口范围(7000-7014)。我添加了一个入站规则来做到这一点。我仍然无法连接。
【问题讨论】:
-
这是superuser.com/q/643115/166855 的故意重复查看 ftp/Azure 问题已经在所以它似乎更适合这里。也就是说,它可能是 stackoverflow.com/q/18422391/575530 的副本(尽管在那里工作的答案在这里不起作用)或 stackoverflow.com/q/17101779/575530 (我正在调查那里的答案,看看它是否适合我)。
-
我删除了 FTP 站点并再次尝试。它现在有效,但我不知道为什么!如果我发现我会把它作为答案发布。