2

I have installed the pure-ftpd package with PureFTP 1.0.24 on Ubuntu 10.04 using apt-get.

Even though, this is the default port range, I've added the file /etc/pure-ftpd/conf/PassivePortRange containing:

30000 50000

This does add the correct option to the command as it is run (-p 30000:50000), but for some reason, I still get connections trying to use ports above 50000. I think the problem is that these are active ftp sessions, but what's the point of specifying a port range if it only works for passive mode? Then I still need to open all the ports in my firewall...

Is there a way to specify a port range for all connections (rather than just passive ones)?

1 Answer 1

1

[W]hat's the point of specifying a port range if it only works for passive mode? Then I still need to open all the ports in my firewall...

From the server's point of view, active connections are outgoing connections, so that premise is wrong.

Since the client has to accept the incoming active connection, the client also specifies which port is going to be used. This is part of the FTP specification. Limiting the port range server-side doesn't make any sense in this case. What if the client can only accept incoming connections between ports 20000 and 25000?

1
  • 1
    Ahh!! Thank you. The problem was that I happened to be connecting from another server with similar port-range restrictions, so I was getting error messages like "Could not open data connection to port 59111: Connection timed out" - and thinking this was referring to the server port, but it was actually referring to the client port. So the answer for my situation (connecting from a client with a limited port-range open), is to use passive ftp! :)
    – mltsy
    Oct 8, 2012 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.