Answers to: NFS over SSH. RPC Errorhttp://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error<p>Hi,</p> <p>I have seen many articles saying that to get rid of this error I should be using portmap, that's fine but how do I use it over ssh...</p> <p>I am trying to mount NFS over SSH. I have the server configured to export the share and I can mount it correctly over the network, however company policy is to ONLY allow ssh access.</p> <p>On the server side; ]# cat /etc/exports</p> <p>/home/Shared localhost(rw,no_root_squash,async)</p> <p>]# rpcinfo -p</p> <p>program vers proto port</p> <pre><code>100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 49449 status 100024 1 tcp 36697 status 100021 1 udp 34934 nlockmgr 100021 3 udp 34934 nlockmgr 100021 4 udp 34934 nlockmgr 100021 1 tcp 37221 nlockmgr 100021 3 tcp 37221 nlockmgr 100021 4 tcp 37221 nlockmgr 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100005 1 udp 2051 mountd 100005 1 tcp 2051 mountd 100005 2 udp 2051 mountd 100005 2 tcp 2051 mountd 100005 3 udp 2051 mountd 100005 3 tcp 2051 mountd </code></pre> <p>The on the client side I use 2 ssh tunnels;</p> <p>]# ssh -f -N -L 52051:localhost:2051 my.server</p> <p>]# ssh -f -N -L 52049:localhost:2049 my.server</p> <p>I can telnet to these ports and receive a response. So now I try to mount;</p> <p>]# mount -t nfs -o nolock,port=52049,mountport=52051 localhost:/home/Shared /mnt/Shared</p> <p>mount.nfs: mount to NFS server 'localhost:/home/Shared' failed: RPC Error: Program not registered</p> <p>So it <em>seems</em> as if the problem is caused by mount talking to the local portmap, however I thought the mount options were supposed to stop that. Obviously I cannot forward portmapper from the server to the client's port 111 as that would disrupt the client's portmapper.</p> <p>I am using SUSE 11.2 for the client and Ubuntu 10.04 as the server.</p>enThu, 19 May 2011 08:04:05 -0400Answer by vorbotehttp://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/2557<p>OK, NFS is a means to access remote files as local. </p> <p>As I mentioned before, if you <em>want</em> to use NFS no matter what, you'll need to route it somehow and that boils down to using a VPN (my first choice in this case: OpenVPN). If you are not married to the idea of NFS, there are alternatives. For example, you can use sshfs, a FUSE driver that uses sftp to emulate a remote volume mount where you can do basic file operations: create, remove, edit, move, open, close, etc. It won't be as fast but it will get the job done. Even midnight commander over ssh, already mentioned here, is a good choice that I'd combine with zssh for quick file transfers if sftp is not an option.</p>vorboteThu, 19 May 2011 08:04:05 -0400http://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/2557Answer by sethbrownhttp://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/2550<p>I might be totally misunderstanding what you are driving at, since I have never used NFS in this way.</p> <p>But if you have SSH access to the server where the files are, why not make things simple on yourself, and fire up mc (The Midnight Commander)?</p> <p>Click on Right -&gt; Shell link -&gt; enter user@hostname and hit Enter.</p> <p>It should either prompt you for a password, or if you have passwordless login setup, it should just give you access in the Right panel to the server.</p> <p>Then, you can do whatever files operations you need to do.</p> <p>Of course, if you are doing something fancier than this, just forget I said anything. :)</p>sethbrownWed, 18 May 2011 14:27:23 -0400http://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/2550Answer by vorbotehttp://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/2538<p>As you would have to map several ports simultanously, tunneling through ssh doesn't seem as a practical solution to me. Rather, I would use a VPN. You could even use a SSH VPN if the server on the target host is recent enough.</p>vorboteWed, 04 May 2011 09:19:04 -0400http://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/2538Answer by Saphttp://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/1391<p>I can't use sshfs in my environment, does anyone have an answer to this one? I get the same error.</p>SapWed, 27 Oct 2010 11:18:16 -0400http://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/1391Answer by indienickhttp://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/1288<p>If I may ask, why are you trying to use NFS, tunneled through SSH?</p> <p>Have you tried using SSHFS? All it requires, on the server end, is SSH.</p>indienickTue, 24 Aug 2010 21:13:05 -0400http://linuxexchange.org/questions/1287/nfs-over-ssh-rpc-error/1288