Guichaguri / MinimalFTP

A lightweight, simple FTP server. Pure Java, no dependencies.
Apache License 2.0
160 stars 45 forks source link

Server on Linux not working when accessing from Filezilla on Windows #8

Closed proofrock closed 5 years ago

proofrock commented 5 years ago

Hi, I'm testing MinimalFTP under Linux (x86-64, Arch Linux, JVM 10.0.2) and it doesn't seem to work when accessing it from Filezilla. I thought it was my app, but the minimal code example in your README doesn't work either.

Please note that:

This is the Filezilla log:

Command: PWD Response: 257 "/" CWD Name Command: TYPE I Response: 200 Type set to I Command: PASV Response: 227 Enabled Passive Mode (127,0,0,1,146,245) Command: MLSD Response: 150 Sending file information list... Error: Data connection can't be estabilished. ECONNREFUSED - Connection refused by the server

(I translated from italian, sorry for any imprecision).

Thanks,

--Germano

Guichaguri commented 5 years ago

The problem is probably firewall. You're using passive mode, which picks a random port to start a server. Try setting FileZilla to use active mode instead.

proofrock commented 5 years ago

Hmmm... interesting. There was a firewall, and disabling it does the trick in active mode. In passive mode, same error message even when disabling the firewall (and also running the server as root). I'll use active mode for now, do you know how can I test passive mode ports?

Guichaguri commented 5 years ago

I use Java's automatic port allocation, which picks a random port from an ephemeral range.

I can add an option to disable passive mode in the server, so clients such as Filezilla will automatically pick active mode.

proofrock commented 5 years ago

Would be nice, but don't sweat on it. If you feel like doing it - thanks a lot. No pressure. :wink: