NFS error access denied by server while mounting

Problem

I wanted to share a directory that was on my local computer to a remote computer named medusa using NFS. I did the setup of the NFS server on my local computer and NFS client on the remote computer as described here. However, when I mounted the NFS share on the remote computer, I got this error:

$ sudo mount /mnt/my_nfs_share
mount.nfs: access denied by server while mounting my-local-computer:/path/i/shared

Solution

This turned out to be tricky one! The error message is quite a bit misleading because it turned out that the problem had nothing to do with access. Turns out this remote computer medusa had two Ethernet cards and thus two IP addresses. One of the IP addresses was set to the hostname medusa, but the NFS client was using the second IP address.

The solution was to add the second IP address 192.168.0.100 as an entry in the /etc/exports file:

/path/i/shared medusa(rw,sync,no_subtree_check)
/path/i/shared 192.168.0.100(rw,sync,no_subtree_check)

The rest of the steps I repeated as described in this post. Everything worked fine and I was able to mount the NFS share on the remote computer.

Reference: https://unix.stackexchange.com/questions/106122/

Tried with: Ubuntu 14.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s