Filezilla FTP Server Fails to Retrieve Directory Listing
我也遇到了这个问题,在网上找到了如下感觉最靠谱的解释,但是如何解决我并未试验成功,再加上Total Commander里面FTP功能并未提供诸如set active mode port的功能,就没有继续折腾。反正是我用Xlignt自己搭建的FTP,直接把协议改成SFTP就可以正常连接了。
I'm running Filezilla Server 0.9.45 beta to manage my server remotely. After setting it up, I tested connecting to it using the IP 127.0.0.1
, and it worked successfully. However, to connect to the server remotely, I port forwarded to port 21, and tried to connect using my computer's IP.
Status: Connecting to [My IP]:21...
Status: Connection established, waiting for welcome message...
Response: 220 Powered By FileZilla Server version 0.9.45 beta
Command: USER hussain khalil
Response: 331 Password required for user
Command: PASS *********
Response: 230 Logged on
Status: Connected
Status: Retrieving directory listing...
Command: CWD /
Response: 250 CWD successful. "/" is current directory.
Command: PWD
Response: 257 "/" is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PORT 192,168,0,13,205,63
Response: 200 Port command successful
Command: MLSD
Response: 150 Opening data channel for directory listing of "/"
Response: 425 Can't open data connection for transfer of "/"
Error: Failed to retrieve directory listing
This continues to work locally, but not when connecting remotely... How can I fix this?
- Hay All, How about in prestashop? I've tried the Cary's answer with sftp.pswebstore.com, but status says Connection attempt failed with "ECONNREFUSED - Connection refused by server" – f_anto Jun 25 '16 at 2:03
18 Answers
When you send the port command to your server, you are asking the server to connect to you (on the remote network). If the remote network also has a NAT router, and you have not port-forwarded the port you are sending with your PORT command, the server will not be able reach you.
The most common solution would be to send the PASV command to the server instead of the PORT command. The PASV command will ask the server to create a listening socket and accept a connection from the remote machine to establish the data connection.
For the PASV command to work, you will also need to port-forward a range of ports for the passive data connections. The passive connection ports (which need to be forwarded) should be listed in the FileZilla documentation.
- I have set a custom port range in the Passive Mode Settings (Port 50000 to 50100) and port-forwarded those ports. I also set the transfer type to Passive instead of Active. No Result. – Hussain Khalil Jul 7 '14 at 18:57