Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP setup problem 1

Status
Not open for further replies.

Haunter

Programmer
Jan 2, 2001
379
US
I have a router as a gateway that forwards all ports to my webserver. When I log in through and FTP client and try to add files to the server I get the following error.

425 Possilbe PASV port theft, cannot open data port.

I login fine. I cannot see anyfiles in the user directory.

etc/passwd file entry is this
username:X:503:503:username: /home/username/./:bin/bash

etc/ftpaccess

I am not sure what to put here?
 
It's not ftpaccess that is your problem here. It's how ftp works.

A "normal" ftp connection makes a control connection to a server on port 21. That's the connection over which you type commands. When you transfer data, the server then opens a data connection back to you (using port 20). There's two connections: one that you originated, and one that the server opened for data.

Passive ftp works by the client (that's you) telling the server to use Passive mode-the client opens it's own data connection, and the server uses that. The server is being "passive"- it isn't actively opening connections. There are still two separate connections though.

It sounds like your gateway is blocking the data connection. Or, if you are using nat on the machine you are ftp'ing from, that could be your problem: nat needs special handling for passive ftp because of the two ports it needs to masquerade for you. The ability to do that is generally available but if this isn't your machine you might be out of luck.



Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
I do have control over the server and the route in this instance. I am just not sure how to get around the problem. I have set the route to forward all ports in but I wonder if setting the passive port out is the problem.

I just noticed. The Passive port is try to be opened on teh IP address to the machine with FTP and to the IP to the external router. Can I configure the ftp to forward that port 20 to the IP on the router?

IP mascarading is that like aliasis and how do you do it?
 
No, it's not aliasing. Do a for ftp masquerade

But I'm still not sure how you are set up- is your router providing nat or is the box you are coming from doing it?
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
This is what I have is a PPoE connection that is kept alive by a linksys router that supports PPoE. The linksys supports NAT, using RIP in the router mode. Would it be easier to use Nat on the router? I have the router set up just to be a straight gatway into my server right now. I am not partial to that set-up but was the first one I got working with the web server, but now I have an FTP issue.

Would it be even easier to have Linux keep the connection alive with some protocol it has. I am very new to linux. I know what I want to do just having trouble sorting out HOW.

Help is appreciated. I have a ton of books but just cant seem to solve the issue.

Thanks in advance.
 
I'm still not sure I understand what you are doing, but it sounds like the problem might be the Linksys. Scour their pages or call 'em. Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Basically, my connection is ADSL that requires a dial-up type login to connect. The router will automaitically do this and keep reconnect if the connection is lost for some reason. I use the router to maintain an always on situation with the PPPoE account. It is set up as a gateway to allow all incoming request to be forwarded to my Linux machine. The router handles the proxy information to the other machines. So my setup is Modem->router->Linux.

When the FTP request the PASV mode it looks for a port on my internal IP address. So for instances if my external IP is 66.159.24.X and I FTP to that IP and try to download the FTP client looks on PASV on IP 192.168.1.X. This results in the port theft error.
 
OK, yes, that's exactly it. And that's where the NAT box needs to handle the transaction so that the server instead sees a request on a public ip.

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
So I should set the NAT up on the router end? Ok That will take some reading. You have any good suggestions to info. I would like to have a firm grasp of the topic which I obviously dont at present. And can you point me in the right direction to getting started with the set up?
 
I would have no idea. As I said before, you probably need to take this up with Linksys. Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
OK, ty for the help. I read a good bit on NAT and see what I need to do. You have been extemely helpful in leading me to a solution to my problem. * for you!
 
Well, if you do figure out what to do for this, it would be nice if you share it here. Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top