Network Connectors

nfs4: Fix for the nobody nogroup problem

When using the network file system (NFS) , it’s possible to run into a problem that your files and directories get mapped to the user nobody. I’ll show you the background and explain to you how to deal with the problem.

The problem

When using nfs4 and a freshly installed Linux system it can happen that you run in the situation that all files and directories have no owner and group:

drwxr-xr-x 4 nobody nogroup 4096 Okt 26 17:10 tmp
-rw-r--r-- 1 nobody nogroup 83 Okt 23 00:50 todo
-rw-r--r-- 1 nobody nogroup 97 Okt 23 00:09 todo~

This is because NFS4 needs the id mapping demon idmapd and also a correct config for it.

The solution

Change in /etc/default/nfs-common the line

NEED_IDMAPD=

to

NEED_IDMAPD=yes

and also in /etc/idmapd.conf the parameter Domain to a domain name that needs to be the same in all idmapd.conf configs you’re actually using:

Domain = localdomain

That’s it, restart nfsd and it should work.