Please note that LinuxExchange will be shutting down on December 31st, 2016. Visit this thread for additional information and to provide feedback.

Hi,

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...

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.

On the server side; ]# cat /etc/exports

/home/Shared localhost(rw,no_root_squash,async)

]# rpcinfo -p

program vers proto port

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

The on the client side I use 2 ssh tunnels;

]# ssh -f -N -L 52051:localhost:2051 my.server

]# ssh -f -N -L 52049:localhost:2049 my.server

I can telnet to these ports and receive a response. So now I try to mount;

]# mount -t nfs -o nolock,port=52049,mountport=52051 localhost:/home/Shared /mnt/Shared

mount.nfs: mount to NFS server 'localhost:/home/Shared' failed: RPC Error: Program not registered

So it seems 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.

I am using SUSE 11.2 for the client and Ubuntu 10.04 as the server.

asked 24 Aug '10, 17:50

Dave%201's gravatar image

Dave 1
1112
accept rate: 0%

edited 03 May '11, 03:32

Jazz's gravatar image

Jazz ♦
7811312

Please accept an answer so the question/answer can be finished. Or provide more details so we can help.

(20 Apr '11, 14:27) rfelsburg ♦



If I may ask, why are you trying to use NFS, tunneled through SSH?

Have you tried using SSHFS? All it requires, on the server end, is SSH.

link

answered 24 Aug '10, 21:13

indienick's gravatar image

indienick
14317
accept rate: 17%

Nick, you're right. Am now using sshfs, works fine.

(25 Aug '10, 11:58) Dave 2

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.

link

answered 04 May '11, 09:19

vorbote's gravatar image

vorbote
312
accept rate: 0%

OK, NFS is a means to access remote files as local.

As I mentioned before, if you want 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.

link

answered 19 May '11, 08:04

vorbote's gravatar image

vorbote
312
accept rate: 0%

I can't use sshfs in my environment, does anyone have an answer to this one? I get the same error.

link

answered 27 Oct '10, 11:18

Sap's gravatar image

Sap
1
accept rate: 0%

Sap,

If you post your question as a question and not in the answer section, you will definitely get a reply.

(22 Apr '11, 16:14) davdunc

I might be totally misunderstanding what you are driving at, since I have never used NFS in this way.

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)?

Click on Right -> Shell link -> enter user@hostname and hit Enter.

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.

Then, you can do whatever files operations you need to do.

Of course, if you are doing something fancier than this, just forget I said anything. :)

link

answered 18 May '11, 14:27

sethbrown's gravatar image

sethbrown
511
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×90
×5
×3
×2

Asked: 24 Aug '10, 17:50

Seen: 6,030 times

Last updated: 19 May '11, 08:04

powered by OSQA