SSHFS – How to Mount Remote SSHFS via Intermediate Machine

mountremotesshsshfstunnel

I would like to mount a remote file system (A) using SSHFS, but sometimes I have IP address, access from which is not allowed. So my plan is to access it via another machine (B) in that network. Do I need to mount A on B and then to mount B (and A) on my local computer? Is there a better way to do it?

Update

Just to clarify the procedure:

First, I make a tunnel

ssh -f user@machineB -L MYPORT:machineA:22 -N

And then I mount the remote file system

sshfs -p MYPORT user@127.0.0.1:/myremotepath /mylocalpath

Is it correct?

How do I destroy the tunnel when I am done?

Best Answer

yeah tunneling. You connect machine B, create local tunnel (-L) to SSHd port of machine A then sshfs to localhost to the port of newly created tunnel.

Related Question