Re: Passive means what during FTP?

From: Menno Duursma (pan_at_desktop.lan)
Date: 06/01/05

  • Next message: RC: "Need help printer setup on Redhat Linux"
    Date: Wed, 01 Jun 2005 12:56:41 +0200
    
    

    On Tue, 31 May 2005 15:36:13 +0000, Robert Nichols wrote:
    > In article <d7h10k$1j8e$1@mail.cn99.com>, case <case@c.com> wrote:

    [ ... ]

    > :Why file trasfer failed in Passive mode?

    Misconfigured firewalling.

    > The FTP data transfer uses a connection that is separate from the
    > control connection. Active vs. passive mode selects whether it is the
    > server or the client that opens the data connection. Firewalls can
    > prevent one or the other (or both!) from working.

    Yes. Passive mode is more secure(able) though.

    > Active mode:
    > Over the control connection, the client tells the server what IP
    > address and port number to connect to for the data transfer. The server
    > opens a connection from its own port 20 (FTP-Data).

    Which means the server needs to (re)claim root privilege :-( ...
    Vsftpd drops root after bind()ing to port 21 entirely, if setup to
    passive-mode only.

    > A server firewall needs to allow the outgoing port 20 connection. A
    > firewall on the client needs to be clever enough to look inside the
    > control packet to find the port number and then allow the incoming data
    > connection.

    Ofcource this beaks "ftps" (SSL/TLS encripting atleast the control channel.)
    Since the (otherwise) statefull firewalling code, cannot look inside the
    packets. You'd have no choise but to allow any connection from port 20 to
    your 1024-65535 range.

    > Passive mode:
    > Just the reverse of the above. The server tells the client what IP
    > address and port number to connect to for the data transfer.

    Yes. And the port in in the range: >1024

    > The client opens a connection from its own port 20 (FTP-Data).

    Nope. The client connects from port >1024 , so the connection looks like:

    Request PASV:

    Client port >1024 ==> Server port 21

    Server opens a local port >1024 listener, and tells the client about it,
    client connects to that port for data transfer:

    Client port >1024 ==> Server port >1024

    > A client firewall needs to allow the outgoing port 20 connection.

    No it does not. It only needs to allow outgoing connections from ports
    above 1023 (or, and tighter: whatever the ip_local_port_range is set to)
    to the server ports 21 and 1024-65535 ...

    And since it's only outbound connections (initiated from the client) there
    isn't any problem in encripting the control connection, i.e.: ftps

    > A firewall on the server needs to be clever enough to look inside the
    > control packet to find the port number and then allow the incoming data
    > connection.

    Well, you could do that. But it doesn't buy anything since the ports are
    in closed state already, untill the server starts a listener for some data
    connection which in turn triggers the "firewall" to poke a hole. So you'd
    be "protecting" closed ports only - which seems kind of silly to me ...

    Now again what this _does_ do is break SSL/TLS encripting of the control
    channel (which, when configured correctly, provides some _actual_ security.)

    Simply setup the server to use a passive port-range, and allow that
    through the firewall. If the Netfilter is host-based (i.e.: local) one can
    even configure it to allow outbound (reply) packets, in that range, from
    the account the server runs as only ( man iptables <-- look for "owner" .)

    > In both cases, any intervening NAT routers introduce an additional layer
    > of complexity.

    Any Masq/NAT machine on the _client_ network isn't a problem (even with
    SSL/TLS), provided: passive-mode is used ...

    > Suffice to say they need to be "FTP-aware".

    No they don't. Only if either active-mode needs to be supported, or the
    NAT machine is in front of the _server_ network (in which case you'll need
    to port-forward 21 and the passive-data range.)

    -- 
    -Menno.
    

  • Next message: RC: "Need help printer setup on Redhat Linux"

    Relevant Pages

    • Re: callbacks in TAO
      ... most firewalls will allow you to poke a hole in it by port number and then redirect the request to some internal server with a given ... port and internal IP address. ... In this case the -ORBListenEndpoints command line argument is useful on the client side. ... client-to-server connection as its callback connection, but I would hope that bidirectional IIOP would work in this case...never ...
      (comp.object.corba)
    • Re: callbacks in TAO
      ... have you tried just specifying the port range on the client side ORB? ... The portspan option can be used tell the server to select any port from a narrow band, which allows a collection of servers to share a limited group of addresses. ... Part of the Bidir connection negotiation is the client supplies the callback address as an alias. ...
      (comp.object.corba)
    • Re: Still cant connect to RWW or OWA remotely
      ... it certainly appears to be something about the SBS configuration. ... Meridian.local Ethernet adapter Local Area Connection: ... Windows SMALL BUSINESS SERVER 2003 Windows IP Configuration ... 192.168.254.254) directly to a port on the router and then ...
      (microsoft.public.windows.server.sbs)
    • Re: Still cant connect to RWW or OWA remotely
      ... it certainly appears to be something about the SBS configuration. ... Meridian.local Ethernet adapter Local Area Connection: ... Windows SMALL BUSINESS SERVER 2003 Windows IP Configuration ... 192.168.254.254) directly to a port on the router and then ...
      (microsoft.public.windows.server.sbs)
    • Re: forwarded-tcpip vs. direct-tcpip
      ... "direct-tcpip" is initiated by the client at any time with no ... network connection to some address and port number, ... "forwarded-tcpip" is sent by the server to the client after the ...
      (comp.security.ssh)