Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an NFS4 share and I need to use it for 2 remote machines However, folders that were created on machine 1 are not writeable for machine 2, giving the error "Permission denided".

How should I configure NFS?

Also machine 2 may write to a folder that was created on machine 1 if only signed as root, but that way is wrong for me.

share|improve this question
What mechanism are you using to synchronize your UIDs and GIDs between the machines: manual passwd file edits, NIS, LDAP, or something else? – Magellan Jan 18 '12 at 13:20
You also should run 'mount | grep -i nfs' and provide that information. – Magellan Jan 18 '12 at 13:23 on /mnt/plf type nfs4 (rw,lock,proto=tcp,addr=,clientaddr= – Roman Iuvshin Jan 18 '12 at 13:36

Write access for NFS has to be configured carefully:

  • First, the share definition in /etc/exports should allow writing (I'm sure this is already the case in your setup, but sharing the contents of your /etc/exports wouldn't hurt), e.g.

    /srv/share *(rw,sync,all_squash)
  • Next, you should be aware as what user you access the NFS share on the server. In the example above, all remote users are mapped to one user (typically nfsnobody) on the NFS server. This user should have write access on your shared directory. You can chown the shared directory to fix this:

    chown -R nfsnobody:nfsnobody /srv/share
  • Also, if you're working on a RedHat-like distribution, make sure your SELinux settings are correct. I'm not going into that now, as it depends on the specific distro/version you're using.

share|improve this answer
my exports is : /var/nfs_drive,no_subtree_check,no_root_squash) is it wrong? – Roman Iuvshin Jan 18 '12 at 14:31

Using NFS also requires that you map your User IDs (UIDs) and Group IDs (GIDs). If the IDs are not synchronized between servers, NFS will work fine but the NFS server will not allow access to those by processes on the NFS client.

Even if you ahve usernames and groups that are identically named, you must have mapped IDs because the UID and GID numbers matter, not the name.

Such as this line from /etc/passwd:


The first number (3rd field) is the UID for that user. If the client server has a DIFFERENT value for that user, they can't see what's owned by the same username on the client.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.