Mount NFS share via a hop server

我怕爱的太早我们不能终老 提交于 2020-05-16 22:05:47

问题


If we have a following situation:

[laptop] ---- [host1] ---- [target]

where host1 is reachable from the my laptop machine, the target from host1 only. We have ssh credentials to both host1 and target.

On the target I have an nfs export with the following properties:

/tmp/myshare 127.0.0.1/32(insecure,rw)

As we can see, I can only mount it locally, from the target machine. I can set up a dynamic tunnel:

ssh -J host1_user@host1 -D 127.0.0.1:8585 target_user@target

but when trying:

sudo proxychains mount /:tmp/myshare /mnt/share

I get:

mount.nfs: Failed to resolve server /: Name or service not known

I tried then local port forwarding:

ssh -fNv -J host1_user@host1 -L 3049:localhost:2049 target_user@target

When mounting with:

sudo mount -t nfs -o port=3049 localhost:/tmp/myshare

it times out. Is this a correct way?

来源:https://stackoverflow.com/questions/61433031/mount-nfs-share-via-a-hop-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!