3

NFS over LAN seems to work as expected - one downloads nfs-utils rpm, makes a share, modifies ownership and SEL, allows nfs in firewalld, launches nfs-server daemon, and everything is good to go.
Wanting to access files over the internet, I setup an SSH tunnel, as a quick alternative to implementing and maintaining kerberos, however nothing is working as exptected.

Given the following topology:
NFS-server (192.168.1.2) - Gateway (LAN 192.168.1.1, WAN 1.2.3.4) - Internet - Home

I've tried setting up SSH tunnel directly to NFS server:
home: ssh -fNv -L 2049:localhost:2049 NFS-server

and via Gateway:
home: ssh -fNv -L 2049:192.168.2:2049 Gateway

Ultimately, when mounting either option on home pc,
home: mount -o port=2049 -t nfs localhost:/var/nfsshare /mnt
I get the same response - requested NFS version or transport protocol is not supported

I've been reading up peoples experience with NFS over SSH and it seems to range greatly, from people just getting it to work , to having to configure services never mentioned with plain NFS - i.e. rpcbind, nfs-lock, nfs-idmap.

So my question is, should NFS with SSH 'just work', or does SSH forwarding introduce something that NFS can't handle natively?

3
  • This requires NFSv4 at minimum. You didn't specify what NFS version you are using on both ends. You probably also have to specify TCP explicitly. Commented Nov 25, 2018 at 20:50
  • Instead of using localhost try using the IP the service is normally connected from. ssh -fNv -L 2049:192.168.1.2:2049 NFS-server Commented Nov 26, 2018 at 2:38
  • @MichaelHampton, @ivanivan - thanks for the help, turns out what was missing was insecure in the exports option. Other than that, everything is behaving as expected. Commented Nov 26, 2018 at 12:22

1 Answer 1

2

Turns out what was missing was insecure in the exports option. Other than that, everything is behaving as expected

1
  • 1
    Can you share your /etc/exports? I'm trying something similar, and getting mount.nfs4: access denied by server while mounting localhost:/media, even though I have specified insecure in my /etc/exports: /media 127.0.0.1(ro,no_subtree_check,insecure,no_root_squash,sync) Commented Apr 20, 2020 at 1:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.