Koozali.org: home of the SME Server

Changing default FTP port

Jean Zouki Junior

Changing default FTP port
« on: August 01, 2000, 08:01:26 PM »
First of all I'd like to congratulate you for the excelent work on e-smith!!!! I've been testing it for the last couple of days and I'm really impressed!

I'm trying to change the default FTP port (21) to a new port (8021) because I'm behind a firewall that does not allow any connections from the outside world in ports lower than 1024.

In order to do that I've done the following:

i) Changed services template to indicate "ftp 8021/tcp"
ii) Changed proftp template to indicate "port 8021"
iii) Set FTP access to public
iv) Rebooted and made sure the /etc/ files were modified

After doing so, I was able to establish a connection to my server from a random computer in the Internet and I even logged in without problems.

However, if I try to issue any command, as simple as "ls" the server responds:

"500 Illegal PORT command.
425 Can't build data connection: Connection refused"

Is there anything else I should modify? If not, have I done something wrong?

Thank you for your help!!!

Jean Zouki Junior

Carl Milloshewski

RE: Changing default FTP port
« Reply #1 on: August 03, 2000, 03:44:51 PM »
FTP uses two TCP channels. TCP port 20 is the data channel, and port 21 is the command channel. FTP is different from most other TCP/IP application programs in that it uses two channels(ports) for communication.

From your description you have only redirected one channel, and in the configuration sections there really isn't a way to tell FTP to use something like 8020 as in your case for the second data channel.

There is a program that people have reported success in using, it's called "redir" and can be found by searching freshmeat.net for "redir".