LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 05-09-2011, 01:54 PM   #1
drobert
LQ Newbie
 
Registered: Dec 2007
Location: Budapest, Hungary
Distribution: Fedora Core 11
Posts: 10

Rep: Reputation: 0
ftp proxy via ssh tunnel on server side using what?


Hi All!

I have 3 pc running linux:
- A is my PC, a client
- B is a server that can be directly reached from A, ssh server
- C is a FTP server that can be directly reached from B, but not from A

I need FTP transfer from C to A. I have a working ssh connection from A to B with local port forwarding (ssh user@host -L 1234:127.0.0.1:1234) and I need something else maybe like nc (netcat) to be able to use my browser on A with an URL like ftp://ftpuser:ftppw@127.0.0.1:1234 . So the netcat (or what) should act as a relay or proxy. How would you solve that? Actually without writing a C program - as I try to avoid this and save myself some work

So any idea?

Regards,
Robert
 
Old 05-09-2011, 03:36 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
Close but not quite. It's simpler than that. in the local tunnel declaration, change the 127.0.0.1 to the ip or hostname of C and then that will give you a connection from A to C. TBH though, not sure how well FTP will fair with its funky port allocation. You may well actually want to look at a socks proxy via ssh instead of a single port, and use a socks capable ftp client.
 
1 members found this post helpful.
Old 05-09-2011, 03:57 PM   #3
drobert
LQ Newbie
 
Registered: Dec 2007
Location: Budapest, Hungary
Distribution: Fedora Core 11
Posts: 10

Original Poster
Rep: Reputation: 0
Well the idea was good, and there really is some dynamic port allocation stuff that doesn't work with this solution. Now I see how I could solve this in C by writing my own ftp proxy in C.

But any further idea is still welcome!

Thanks,
Robert
 
Old 05-09-2011, 04:38 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
I don't think you've understood what I said. use ssh as a socks proxy and point your socks capable ftp client at it. very simple.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help for SSH tunnel through NTLM-authenticated HTTP proxy theYinYeti Linux - Networking 3 02-25-2012 02:15 PM
ftp over ssh tunnel; ftp refuses to work jakykong Linux - Networking 16 10-16-2011 07:34 AM
How do I set up an ssh tunnel through a http proxy? wilko Linux - Networking 2 03-10-2010 01:05 PM
SSH and secure FTP tunnel from remote computer : Is this scenario possible ? uncle-c Linux - Newbie 3 12-04-2008 04:14 PM
SSH Tunnel and FTP Issues ayrton Linux - Networking 2 02-16-2004 05:03 AM


All times are GMT -5. The time now is 11:07 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration