让 FTP 在 Azure VM 上运行,克服 ftp 客户端上的“连接关闭”问题

2024-03-05

我正在努力连接到 Azure 中新 VM 上的 FTP。

我从默认映像(Windows Server 2012 Datacenter)创建了一个新的虚拟机,并通过 RDP 连接到新的虚拟机中。然后,我启用了 Web 服务器 (IIS) 角色,包括 FTP 服务器,并使用 Web 平台安装程序中的推荐设置配置了 IIS。然后,我使用 IIS 管理器“添加 FTP 站点...”向导来添加具有 root 权限的 FTP 站点%systemdrive%\inetpub\ftproot并将 ftp 站点设置为启用匿名身份验证,允许匿名用户读取访问,指定数据通道端口范围 7000-7014,并将防火墙的外部 IP 地址指定为虚拟机仪表板中的公共虚拟 IP (VIP) 地址。 Azure 管理门户。

防火墙还配置为允许 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

我跟着罗纳德的门演练:在 Windows Azure VM 中的 IIS 7.5 上托管 FTP http://www.itq.nl/blogs/post/Walkthrough-Hosting-FTP-on-IIS-75-in-Windows-Azure-VM.aspx并添加了两个端点以允许访问端口 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 ==========

我想知道是否适用于 haxor 的解决方案 https://stackoverflow.com/a/17263963/575530可能会解决问题。这引用了'的答案Azure 上的 Server 2012 VM - 被动 FTP 不起作用 http://social.msdn.microsoft.com/Forums/windowsazure/en-US/8f697f17-72b7-46f7-8c97-398b91190a2f/server-2012-vm-on-azure-passive-ftp-wont-workWindows Azure 虚拟机论坛上指出,如果通过 Azure 门户在被动端点上配置探测器,那么它们可能无法工作。尽管答案指出此问题已在最新版本的门户中修复,但建议使用 Azure Powershell cmdlet Add-AzureEndpoint 以确保不启动任何探测。我已使用 Azure Powershell cmdlet Get-AzureEndpoint 检查过,我的 ftp 端点都没有探测器,因此这不是我的问题。

========== 编辑 2 ==========

我注意到一个步骤IIS8 和 Windows Azure 虚拟机中的被动 FTP 和动态端口 http://fabriccontroller.net/blog/posts/passive-ftp-and-dynamic-ports-in-iis8-and-windows-azure-virtual-machines/中没有提到原来的演练 http://www.itq.nl/blogs/post/Walkthrough-Hosting-FTP-on-IIS-75-in-Windows-Azure-VM.aspx:在Windows防火墙中打开数据通道端口范围(7000-7014)。我添加了一条入站规则来执行此操作。我仍然无法连接。


更完整的说明可以在以下位置找到:http://blogs.msdn.com/b/wats/archive/2013/12/13/setting-up-a-passive-ftp-server-in-windows-azure-vm.aspx http://blogs.msdn.com/b/wats/archive/2013/12/13/setting-up-a-passive-ftp-server-in-windows-azure-vm.aspx我按照那里的说明进行操作,FTP 在 Azure 上运行得很好。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

让 FTP 在 Azure VM 上运行,克服 ftp 客户端上的“连接关闭”问题 的相关文章

随机推荐