ispCP - Board - Support
[Solved] Changigng Filemanager's FTP port? - Printable Version

+- ispCP - Board - Support (
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: [Solved] Changigng Filemanager's FTP port? (/thread-16072.html)

[Solved] Changigng Filemanager's FTP port? - csacsa62 - 05-21-2012 03:48 AM


After installed ispCP and a lot of security modifications, I've changed the default FTP 21 port number to higher one in /etc/proftpd/proftpd.conf. Next changed the default port number to same in "PORT_FTP" field in "config" table of "ispcp" db in MySQL. Everything works fine, all rows green in Server Status page, I can connect and log in to server on high port with FTP(S) clients.
But net2ftp (Filemanager) stuck on port 21, the error message after login attempt:

Unable to connect to FTP server localhost on port 21.

Can't find other info for ftp port in db and in flat config files. Googled a lot, dug in ispCP docs and forum with no success. The problem is not depend to base system and ispCP version (two servers: ispCP 1.0.5 on FreeBSD 8.0 and ispCP 1.0.7 on Debian 6.0.5).

Can someone help me?

Thanks in advance.

RE: Changigng Filemanager's FTP port? - ephigenie - 05-22-2012 04:46 PM

please take a look in :

look out for
$net2ftp_settings["allowed_ftpserverport"] = "21"

change it to your desired new port.

RE: Changigng Filemanager's FTP port? - csacsa62 - 05-26-2012 06:56 PM

Thank you, Ephigenie!

Might I'm partially blind grep'd through filemanager's includes dir but missed the settings* files under my nose. Smile

I needed a quick 'n dirty solution, and put these lines in /etc/rc.local (supposed high ftp port is 12345):

iptables -t nat -I PREROUTING -p tcp --dport 21 -j REDIRECT --to-ports 12345
iptables -t nat -I OUTPUT -p tcp -d --dport 21 -j REDIRECT --to-ports 12345

It's more secure (for one who is a paranoid like me Smile ) because net2ftp talks with ftp server transparently on localhost port 21 but ftp on all IPs is silently listen on high port.