NFS Client reports Permission Denied, Server reports Permission Granted

nfs

I have two RedHat 4 Servers. The client is 4.6, the server is 4.5. I'm attempting to mount a share from the server, onto the client via NFS.

The /etc/exports configuration is as follows:


/opt/data/config bkup(rw,no_root_squash,async)
/opt/data/db bkup(rw,no_root_squash,async)

exportfs returns these (among other) shares, nfs is running according to ps output.

I've been attempting to use autofs on the client, but have opted to just mount the share manually considering the issues I'm having.

So, I issue the mount request:
mount dist:/opt/data/config /mnt/config

mount: dist:/opt/data/config failed, reason given by server: Permission denied

Ok, so let's see what the server has to say for itself.

May 6 23:17:55 dist mountd[3782]: authenticated mount request from bkup:662 for /opt/data/config (/opt/data/config)

It says it allowed the mount to take place.

How can I diagnose why the client and server are disagreeing on the result?

Best Answer

This is a good example of the difference between authentication and authorization. In this scenario the authentication succeeded, but the authorization on the host's directory is likely to be the problem. To test, you can try setting the host's directory permissions recursively to 777 (don't forget to change this again later).

Things to check:

  • Are the username and uuid of the user on the client and the host the same?
  • Are permissions correctly set on the host?
  • Does NFS on the host server have correct permissions to access the files it is supposed to share? ie. Is NFS running as root, and if not, do the files it is trying to access have correct permissions set to allow them to be accessed by the NFS daemon itself?