0
votes

I would like to connect to an FTP destination and write a file to it. FTP abruptly closes after entering PASV mode. There is nothing wrong with the FTP server setting as such. I am not really sure what I can fix on the FTP server to fix this problem. Any ideas?

enter image description here

1
It looks like the close is initiated on the client side, so look there for error messages.Steffen Ullrich
on the client side I get this error and nothing else "First document failure: access denied ("java.net.SocketPermission" "10.xx.xxx.xxx:123456" "connect,resolve")"lonelymo
Is the IP address in the client message the same as the servers IP the client accessed or is it the non-public IP address of the server?Steffen Ullrich
It is the non-public IP that the client getslonelymo

1 Answers

1
votes

Q: Is the IP address in the client message the same as the servers IP the client accessed or is it the non-public IP address of the server? --- A: It is the non-public IP that the client gets.

This sounds like a FTP server behind a NAT which provides the internal private IP address in the reply for the PASV command. Since the client is probably not in the same private network this private address is not reachable by the client. Thus the client gets the following error:

"java.net.SocketPermission" "10.xx.xxx.xxx:123456" "connect,resolve"

FTP where one side is behind NAT conflicts with the general architecture of the FTP protocol, that is dynamically created data channels where the endpoints get announced within the control connection. If only one of the peers is behind NAT you can usually work around it by using either passive mode (client behind NAT) or active mode (server behind NAT). If both peers behind NAT or if you want to use passive/active mode in an unsuitable scenario it gets more complicated and you usually need either helpers on the router/firewall or specific configurations for the client/server and lots of ugly port forwarding.