Hello! and thanks in advance for the help.
I've gotten virtualmin running on an ubuntu 10.04 LTS on amazon ec2. DNS is hosted externally. My first virtual domain is working properly on http.
However, when I try to login to that domain as the default Ftp user, my client connects but then shows me that my home folder is empty. Looking at the folder as root from ssh, it is clearly not an empty folder.
I was having problems with my internal vs external address when setting up apache, so I think this is the culprit again. My ftp client tries connects to my domain with no problem, but then it tries to connect to another port (not 21) using my internal ip address. I guess that proftpd is telling my client what ip to connect to, and is using the internal ip instead of the external.
I've looked through my settings and a few config files, but I must be missing something.
Anyone know?
2nd question: I'm not very familiar with how Ftp works-- why does it connect to another (seemingly random) port? How do I rectify this randomness with my firewall?
Thannks!
FTP uses two connections. "Control" to port 21, and "data" to a randomly chosen port for each transfer - including directory listing, which is probably why your directory appears empty. It is not empty - just the transfer to fetch its content listing failed.
If your client connects to the server for data, that is called "passive mode". You need to configure the server (ProFTPD) to use the external IP address in the "PASV command reply", and - if using a firewall or NAT router - to use a specific port range.
You do that using the Webmin ProFTPD module, section Virtual Servers -> Default -> Networking Options -> Masquerade as Address / PASV Port Range.
In case of firewall/router, you also need to configure that to allow the PASV port range through / to port-forward that range.
Awesome. That did it. Thanks!
You're welcome, and also welcome to the club of admins successfully operating FTP behind a firewall/router (which as you see can be a bitch). ;)
Hi there,
sorry for pulling this old one out but i got the same issue.
Webmin Server is on a VM bound to a local ip - Masquerade is set to static public ip - PASV Port Range is set and also forwarding in router for PASV ports and Control port are active
FTP Client gets right (Masquerade'ed) public ip announced by server but doesn't choose ports in given range ?! Shouldn't the FTP Server announce also allowed port range? Result, get empty directory listings... if create new folder in connected client it is created on server but client doesn't get any directory listings.
What do i miss here?
Thanks for any hints, if any more info needed please let me know
BR Appovis