LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ftp proxy via ssh tunnel on server side using what? (https://www.linuxquestions.org/questions/linux-software-2/ftp-proxy-via-ssh-tunnel-on-server-side-using-what-879696/)

drobert 05-09-2011 01:54 PM

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

acid_kewpie 05-09-2011 03:36 PM

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.

drobert 05-09-2011 03:57 PM

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

acid_kewpie 05-09-2011 04:38 PM

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.


All times are GMT -5. The time now is 12:23 PM.