Networking Forums

Networking Forums > Computer Networking > Linux Networking > Tunnel ftp through SSH

Reply
Thread Tools Display Modes

Tunnel ftp through SSH

 
 
Alexander Duenisch
Guest
Posts: n/a

 
      11-19-2003, 08:23 AM

Hi

I'm using Proftp, running in standalone in a
Firewalled Network. I want to make FTP
accessible to the Outside using an SSH Host
which can open connections to both sides.
Tunneling SSH Connections works fine.
It's the FTP where I'm stuck.
My proftpd.conf shows:

"AllowForeignAddress = On"

Port 21 is forwarded correctly.
Client uses Passive FTP.

Login seems to work, but then no data channel
is opened. I don't even get a directory listing.

Any suggestions what I could have overlooked ?

Thanks in advance

alex





 
Reply With Quote
 
 
 
 
Achim Keller
Guest
Posts: n/a

 
      11-19-2003, 08:36 AM
Alexander Duenisch wrote:

> Port 21 is forwarded correctly.
> Client uses Passive FTP.
>
> Login seems to work, but then no data channel
> is opened. I don't even get a directory listing.
>
> Any suggestions what I could have overlooked ?


The data channel uses port 20, so I guess you need to forward that one too.

Achim

 
Reply With Quote
 
Alexander Duenisch
Guest
Posts: n/a

 
      11-19-2003, 05:21 PM
Am Wed, 19 Nov 2003 10:36:16 +0100 schrieb Achim Keller:

> Alexander Duenisch wrote:
>
>> Port 21 is forwarded correctly.
>> Client uses Passive FTP.
>>
>> Login seems to work, but then no data channel
>> is opened. I don't even get a directory listing.
>>
>> Any suggestions what I could have overlooked ?

>
> The data channel uses port 20, so I guess you need to forward that one too.


yeah, but not in passive mode ...

> Achim



 
Reply With Quote
 
Wayne Throop
Guest
Posts: n/a

 
      11-19-2003, 05:43 PM
:: Port 21 is forwarded correctly. Client uses Passive FTP. Login
:: seems to work, but then no data channel is opened. I don't even get
:: a directory listing. Any suggestions what I could have overlooked ?

: The data channel uses port 20, so I guess you need to forward that one too.

So far as I know, the data channels use pseudo-randomly selected ports.
Which makes it very very very very (and did I say "very"?) difficult
to forward the service statically.

But first of all, if you have an ssh link, why not use sftp? Or scp?
Or rsync? Or ssh foo tar -cf - whatnot | tar -xvf or similar?

Second, if you absolutely, positively, must use ftp, then you
will need to use ssh's -D facility, and one of runsocks,
dante socksify, or a socks-enabled ftp (or similar).

-D port
Specifies a local ``dynamic'' application-level port forwarding.
This works by allocating a socket to listen to port on the local
side, and whenever a connection is made to this port, the connec-
tion is forwarded over the secure channel, and the application
protocol is then used to determine where to connect to from the
remote machine. Currently the SOCKS4 protocol is supported, and
ssh will act as a SOCKS4 server. Only root can forward privi-
leged ports. Dynamic port forwardings can also be specified in
the configuration file.

And if you cannot use any of those (eg, the ftp client is part of
an app you can't socksify or modify), then you'll probably have to
download, configure, and use a socksified ftp proxy (I did that
once; one of the major ftp implementations has a good proxy mode
but I forget off the top of my head which one... I guess google
for it if you need to be this extreme.)


Wayne Throop (E-Mail Removed) http://sheol.org/throopw
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with VPN tunnel Bill Network Routers 0 05-05-2010 07:54 AM
VPN Tunnel Robert Craig Windows Networking 12 11-18-2008 01:52 PM
Tunnel X over ssh Joe Hesse Linux Networking 1 10-30-2007 05:45 PM
ssh tunnel kristian Linux Networking 3 03-31-2006 08:04 AM
FTP Using SSH Tunnel Buck Turgidson Linux Networking 3 09-16-2004 06:59 PM



1 2 3 4 5 6 7 8 9 10 11