Cannot use ftp from a remote location

I’ve been trying to get my ftp server accessible from anywhere outside my own network (server at office, can’t ftp from home) and having no luck. I am able to connect and login, but then cannot list folder contents. Error message is:

“failed to retrieve directory listing”

I’ve already tried modprobe ip_conntrack_ftp without success. I’ve also tried disabling ipv6… Help?

You might want to try passive mode on your client.

If your server is behind a firewall, you need to configure the passive mode port range in ProFTPD and open the selected ports. (Do a forum search for that topic; there’s been a thread about this just 2 or so days ago where I explained it.)

I’ve tried active mode, passive mode, forwarding ports 49152-65534, and settings for default Proftpd server seem to be correct. Ports are also forwarded in my router. FileZilla or gftp outputs:

Looking up mydomainname.org
Trying mydomainname.org:21
Connected to mydomainname.org:21
220 ProFTPD 1.3.2c Server (Debian) [::ffff:192.168.0.99]
USER myuserrname
331 Password required for myuserrname
PASS xxxx
230 User myuserrname logged in
SYST
215 UNIX Type: L8
TYPE I
200 Type set to I
PWD
257 “/” is the current directory
Loading directory listing / from server (LC_TIME=en_US.UTF-8)
PASV
Connection to mydomainname.org timed out
Disconnecting from site mydomainname.org

Ideas?

You need to set the PASV Port Range in the screenshot you posted.

I’d also suggest to not forward a huge range like 49152-65535, but choose a specific range of about 20 ports for FTP and forward those. Most important is that the range matches in your router and in ProFTPD’s “PASV Port Range” setting.

I tried forwarding 49152-49182 pasv ports in both my router and in Virtualmin’s Proftpd server setting> Networking options.

It did NOT work… Any other ideas?

I just tried the test login you sent me via email, and your FTP server completely stops responding when I issue the PASV command. Something odd is going on there, haven’t seen this behaviour before… You might want to check the syslog and the ProFTPD log for errors during the last minutes.

Not off the bat. You could tell me login details and the IP via email (****** email erased to prevent spammer harvesting) so I can do some tests from my end.

Ok, this is weird… Just for the sake of trying I have tried from another location… and with total success. I am able to login and also retrieve the directory listing. Not sure if it will continue to work when I get back home. I changed nothing.

I do see where you tried to login as the test user I created for you. Error from Proftpd log is:

REFUSED PORT 10,0,0,1,50,20 (address mismatch)

I am thinking this might be something with my small-town ISP because for some time I was also unable ot access any websites stored on my server from other computers on the same ISP, then magically one day they must’ve made changes and all of a sudden websites started showing up when I tried from other connections from my same ISP. I am wondering if they’ve made changes very recently or what could’ve happened to make me able to login from this location (I’ve tried this location before as well and was unsuccessful - could not list directory.)

Thanks for trying to solve this strange problem. If the problem persists when I get back to my normal location, I will post here again. As it looks now, the problem seems to be solved… ?? Weird.

The PORT error message you’ve seen is the result of another test I made and not related to the main issue.

You should look for odd behavior in connection with the PASV command, which as I said causes your FTP server to become completely unresponsive. This is something I have not seen so far with ProFTPD. You might want to use a packet capture software (“tcpdump” on Linux, “Wireshark” on Windows) to capture network traffic and see what’s being done on a low level. Also check the syslog and stuff for problems during PASV setup.