1

I'm doing some experiments with some computers I have, I have the following scenario

local network
  host1 [ubuntu]
vps [internet]
  host2 [CentOS]

I have an external hard disk connected to the host1 and my goal is to be able to access those files from the host2(VPS)

I can reach the host2 from the host1 over ssh but not backwards

host1 ---ssh--> host2 //possible
host1 <--ssh--- host2 //not possible

what I have done so far:

I tried using sshfs with reverse tunneling but I just can't have it work, I have seen lot's of examples where the connection is done from host2 to host1 but in my case since I can't ssh to host1 the samples I see don't work and there is very little info about reverse tunneling with sshfs

also, I tried with mount-on but it didn't work

is this possible under these conditions? if so, what am I missing? is there something easier?

thank you

2
  • You say you can reach host1 from host2 but not reverse. You really need to fix this before trying to get NFS working. What about setting up a VPN from host 2 to host1, then connecting over that? It's more secure for NFS as well.
    – davidgo
    Commented Apr 1, 2018 at 5:03
  • yes, that is a problem, actually, right now I'm trying to set up a network tunnel between those hosts, I will give it a try and update :) Commented Apr 1, 2018 at 5:11

2 Answers 2

4

is late but... maybe other can use this.

If you want to connect the remote server to your local computer, make a tunnel with ssh.

$ ssh -NR 6969:localhost:22 my-ssh-key

Then you have a connection on the remote server in port 6969 to your local machine. Now just type this code to connect your local directory to the remote server.

$ sshfs -p 6969 YOUR_USER@localhost:/LOCAL_DIRECTORY/ /YOUR_REMOTE_MOUNT_POINT/

0

after struggling, for a couple of hours, I found out that there is no way to solve the issue without having bidirectional communication, so, what I did was to set up a VPN to have communication from the host2 to host1.

The full detailed procedure that I followed is available here hope it helps you if you are trying to accomplish something similar

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .