the context is I have a Chinese ipcamera which needs to send security footage on a remote ftp server.
I have configured a pure-ftpd server which works correctly on LAN. I have defined a PassivePortRange and set ufw rules and opened the corresponding ports on my router. The problem is when I try connecting from outside the local network.
Status: Connecting to x.x.x.x:21...
Status: Connection established, waiting for welcome message...
Status: Plain FTP is insecure. Please switch to FTP over TLS.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "****" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (x,x,x,x,191,155)
Command: MLSD
Response: 150 Accepted data connection
Response: 226 21 matches total
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
The ports are confirmed accessible from outside (using port checker tool). I noticed when checking open ports that pureftp binds to local address
tcp 0 0 192.168.x.x: 0.0.0.0:* LISTEN 124031/pure-ftpd (U
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 123798/pure-ftpd (S
tcp 0 0 192.168.x.x: 0.0.0.0:* LISTEN 122365/pure-ftpd (I
I am not sure if this is the source of my problem. I have also tried setting ForcePassiveIP, but with absolutely no change in remote connection behaviour. I am aware that my problem is somewhere in my configuration, however after several hours of troubleshooting, I can't seem to find the root cause.