PureFTPD Passive mode using ports outside defined Port Range
AnsweredI have seen that cPanel uses port range 49152-65534 for passive FTP.
I checked the /etc/pure-ftpd.conf file and it has those ports defined for passive range.
I need to FTP to this server from a script on another server.
So I opened this port range in ConfigServer firewall on both servers.
The problem is that ports outside this range are being used in many times, and connections are being refused due to those other ports not being open in firewall.
I see errors of connection refused for ports 39458, 47902, 36568, 33012, etc.
Some files get copied, and some not, it depends on the port they get.
I need to know the exact port range that is used so I can open the ports. I don't understand why this is using ports not defined in the configuration file. How can I know the exact port range that is used for passive ftp?
This is a new server with CloudLinux 9 and using cPanel 122.0.18
Thanks!
-
I found that this php script was not calling ftp_pasv($ftp, true) after ftp_login. It had worked well that way for years with other servers, but not with this new one. After adding ftp_pasv() the files are being transferred ok.
0 -
I'm glad to hear you found a solution, as I was going to suggest it would be a problem with the script/connection side since that is the side that decides what port to use, and not the destination side.
0
Please sign in to leave a comment.
Comments
2 comments