Re: sftp over two connections
From: Benjamin Hornberger (benjamin.hornberger_at_stonybrook.edu)
Date: Fri, 11 Mar 2005 11:08:41 -0500
Benjamin Hornberger wrote:
> Hi all,
> I frequently work remotely on a Linux box (call her LIN) in a large
> research lab. The lab's firewall blocks direct access to my machine from
> the public internet, but they offer an SSH gateway (call it GATE) to
> which you can log on from outside, and from GATE you can connect to
> computers inside the lab. So, from my Windows machine (WIN) at home I
> log onto GATE, from there I log onto LIN and I can work on the console.
> X tunneling works as well, and I tunnel additional ports to control
> research instruments which accept TCP connections (through both
> connections). So far, so good.
> Now I would like to establish an SFTP connection from WIN to LIN as well
> for easy file transfer, but I can't figure out how to do it. If I open a
> file transfer window on WIN, I end up in GATE's filesystem, not LIN's.
> Can it be done by setting up a certain tunnel? Or could an NFS
> connection be tunneled through SSH so that I could mount LIN's
> filesystem in a directory on GATE, and then use the SFTP connection to
> access that directory on GATE?
I found the solution: Tunneling the complete SSH connection through an
SSH tunnel. I ssh to GATE, forwarding port X (some free port) to port 22
on destination host LIN. Then I open another ssh connection from WIN to
localhost:X. That's it. Works for the terminal (ssh) and file transfer