Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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)?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

[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?

share|improve this answer
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 '12 at 18:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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