Wednesday, 9 October 2013

Unexpected permission issues when mounting nfs shares (mainly OSX)

The Problem

Some directories are exported via nfs on a linux server. Attempting to mount from OSX produces permission-related errors (Lion), or dialog boxes that advertise a failure to mount but disappear before they can be read (Snow Leopard).

Meanwhile, on the client the command
showmount -e ip_address
correctly shows the exported directories that you expect.

The Solution

This may be down to the server having a default of "expect client to connect over a reserved port", in which case, depending on which end you have control over, modify the way the client connects, or the way the directory is served.

1) In the client: mount the share from the command line, requesting that the connection be made via a reserved port.
e.g. mount -o resvport,rw,noowners -t nfs ip_address:/path/to/share /path/to/mount/point

2) In the server: tell the server not to expect connections over reserved ports.
i.e. edit /etc/exports and add the magic word "insecure" to the relevant mount description
e.g. /path/to/share *(rw,insecure,sync,no_root_squash)

No comments:

Post a Comment