[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ftp not working



>>>>> "Miguel" == Miguel Wooding SF Ten Union <mwooding@thecity.sfsu.edu> writes:

    Miguel> More fundamentally, why would I need to use passive mode? 

FTP uses two kinds of connections: a control connection, and a data
connection. The control connection is made FROM the client TO the
server, and it is the connection that commands and their results are
passed through.

Data connections are made when a file (or a directory listing) needs
to be transferred. One end of the data connection is the "active" end,
and the other end is the "passive" end. The "active" end makes the
data connection, and the "passive" end listens for it. So, the
connection is made FROM the active end TO the passive end.

The "passive" (PASV) FTP command instructs the FTP server to enter
"passive mode", meaning that it (the FTP server) will be the passive
end of future data connections. Which means that the data connections
will be made FROM the client TO the server.

Note that the default behavior for data connections, which is somewhat
surprising, is that the data connection is made FROM the server TO the
client!

The reason you might need to use passive mode, of course, would be
when a connection FROM the server TO the client at a client-specified
port number would be impossible. This can occur

        when you are behind a firewall (that blocks incoming
        connections)

        when you are using IP masquerading/NAT

        when you are using a PPP emulator on a shell account

        when you are using a proxy server (?)

Any of these can, in principle, be made clever enough to make passive
mode unnecessary by detecting TCP connections to the standard FTP port
and fiddling with the data stream. I think slirp could do this, but
it's been a while since I used it; I haven't heard of anything else
that does this.

(Historical note: from skimming RFC 959 it looks like passive mode may
have only been included in FTP to provide a means of transferring
files between two FTP servers without directly involving the client.)
-- 
I get my monkeys for nothing and my chimps for free.
http://www.clark.net/pub/hermit/


Reply to: