嘗試連線到部署在我的 Azure VM 上的 FTP 伺服器時發生錯誤

嘗試連線到部署在我的 Azure VM 上的 FTP 伺服器時發生錯誤

我在嘗試連線到部署在 Azure VM 上的 FTP 伺服器時收到以下錯誤。

Warning: Selected port (18183) is not the default port (21) of the selected protocol.
Warning: The entered address does not resolve to an IPv6 address.
Status: Connected, waiting for welcome message...
Reply: 220-FileZilla Server 0.9.56 beta
Reply: 220-written by Tim Kosse ([email protected])
Reply: 220 Please visit https://filezilla-project.org/
Command: CLNT https://ftptest.net on behalf of 168.63.97.45
Reply: 200 Don't care
Command: AUTH TLS
Reply: 234 Using authentication type TLS
Status: Performing TLS handshake...
Status: TLS handshake successful, verifying certificate...
Command: USER Usera
Reply: 331 Password required for rheinenergie-klima
Command: PASS **********************
Reply: 230 Logged on
Command: SYST
Reply: 215 UNIX emulated by FileZilla
Command: FEAT
Reply: 211-Features:
Reply: MDTM
Reply: REST STREAM
Reply: SIZE
Reply: MLST type*;size*;modify*;
Reply: MLSD
Reply: AUTH SSL
Reply: AUTH TLS
Reply: PROT
Reply: PBSZ
Reply: UTF8
Reply: CLNT
Reply: MFMT
Reply: EPSV
Reply: EPRT
Reply: 211 End
Command: PBSZ 0
Reply: 200 PBSZ=0
Command: PROT P
Reply: 200 Protection level set to P
Command: PWD
Reply: 257 "/" is current directory.
Status: Current path is /
Command: TYPE I
Reply: 200 Type set to I
Command: PASV
Reply: 227 Entering Passive Mode (100,113,144,72,210,89)
Command: MLSD
Reply: 425 Can't open data connection for transfer of "/"
Error: Listing failed

我嘗試在幾個論壇上查找,但找不到具體的答案。到目前為止,我已經在主動和被動模式下進行了嘗試,並通過以下方式進行了測試https://ftptest.net

我啟用了 FTP over TLS,也產生了憑證。

我的連接埠的入站規則(18183 也已新增)。

注意:我沒有使用 FileZilla 伺服器建議的連接埠。

答案1

您提供的錯誤日誌顯示您的 FTP 用戶端正在使用以下命令連接到 FTP 伺服器被動模式

在該模式下,FTP客戶端使用2個頻道:

  • 控制通道(在您的情況下監聽連接埠 18183),向伺服器發出命令
  • 數據通道(如指令所示監聽埠100,113,144,72,210,89 PASV),傳送/接收數據

這種 2 通道模式允許在發送/接收資料時仍然能夠發出命令。

就您而言,我懷疑您的虛擬機器和/或網路安全群組(如果您使用的話)中的某些連接埠未開啟。因此,您需要建立對應的 ACL(存取控制清單)或更新與 VM 關聯的網路安全群組中的入站規則,以允許連接埠 100,113,144,72,210,89 上的 TCP 存取。

答案2

我們也遇到了同樣的問題,因為我們的 azure RM 虛擬機位於 avset 中的互聯網負載平衡器後面,並且所有 NSG 規則在特定連接埠上打開,Windows 防火牆關閉。數據通道連接埠的正確定義請參閱http://www.serv-u.com/respcode.asp?resp=227

錯誤:您似乎位於 NAT 路由器後面。請設定被動模式設定並轉送路由器中的一系列連接埠。

答:我透過在與資料通道連接埠範圍相同的連接埠上的負載平衡器上新增 NAT 規則,使用 filezilla 伺服器使其正常運作。你也可以用PS來做這個$LoadBalancer | Add-AzureRmLoadBalancerInboundNatRuleConfig -Name $NatRuleName -FrontendIpConfiguration $frontendIP1 -IdleTimeoutInMinutes 4 -Protocol TCP -FrontendPort 5000 -BackendPort 5000 | Set-AzureRmLoadBalancer

相關內容