Discussion Locked

FTP Transfer's

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

On a Linux Firewall what module do you use to open Port 20 and Port 21 for FTP transfers bidirectional.

What is the command line you would use to load it, and where would this load command be put so this started everytime the server restarted.And is there a good source on this information (IE:Command Line Switches...)

Thanks for your help.
Steve Bernstecker

10 replies

by kevin anderson

An FTP server will be running by default on Linux.

You'll need a userID and password to connect to it. Those can be created with ADDUSER USERNAME, and then giving a password as prompted.

You'll also need to make the user's initial directory the one you want, and make sure they have rights to it. By default, they will default into their own home directory at /home/USERNAME. You can test the server from your desktop by going to

ftp://USERNAME:PASSWORD@xx.xx.xx.xx

Replace xx with the IP address (also username and password). This should work from IE 4 or better, which seems to be the common desktop.

Kev.

by sbernstecker

I have a client that uses a Linux Firewall and needs to connect to my ftp server to transmit and recieve files. I can get him to log on to my server without any problems through DOS FTP commands.When they do a directory it times out by not allowingthem to recieve data back. I believe that Port 20 is blocked which is what is used to transfer data. I believe Port 21 is open which is what allows them to log in to my server. I Might have these ports backwards for there function. This is why I need to know the settings for FTP so we can set it up with them.

by sbernstecker

I have a client that uses a Linux Firewall and needs to connect to my ftp server to transmit and recieve files. I can get him to log on to my server without any problems through DOS FTP commands.When they do a directory it times out by not allowing them to recieve data back. I believe that Port 20 is blocked which is what is used to transfer data. I believe Port 21 is open which is what allows them to log in to my server. I Might have these ports backwards for there function. This is why I needto know the settings for FTP so we can set it up with them.

by jrtietsort

Assuming that you are using the Masq software to do your firewall, you will need to load the ip_masq_ftp module to do this for you. If you are using a relatively recent distribution, then you probably already have the module compiled.

On RedHat:
/sbin/modprobe ip_masq_ftp

You can insert this command into /etc/rc.d/rc.local to have it run when the machine boots. Good luck...

by kshum

Try having the client configure their ftp client to use passive transfer. This usually helps when you are trying to ftp through a firewall.

by sbernstecker

The Client is propriatary software published by my company and passive was already tried. I can't get data back through dos ftp ar any way else

by wls

The problem you're facing is that FTP uses one set of ports to communicate user requests, and another set of ports to do the file transfer on.

It works like this:
user -> ftp: "I'd like file XYZ"
ftp -> user: "No problem, connect to port 10328 to get it."
user -> ftp: "Gotcha. Be right back."
user -> firewall "I'd like to open port 10328 please."
firewall -> user "Sorry, that port isn't open for incoming traffic."
user -> ftp: "Something's wrong. I'd like file XYZ please."
ftp -> user: "Sure. Let's try port 30226 this time."
user -> ftp: "Uh, okay..."
user -> firewall "Can I connect to port 30226?"
firewall -> user "Look, I told you, that's not a port open for service to incoming traffic."

...this is what passivemode in FTP solves. It reverses the roles so FTP originates, and the firewall lets it through.

Other than that, you'll need an FTP module for your firewall which will selectively open ports on an as-needed basis.

This discussion is closed to new replies.