1

I have an NFSv4 server (CentOS). I want to export a particular directory to two different machines (one CentOS and one Ubuntu), where users of the same uid and gid need read-write access to the mounted directory. The GID and UID are the on the clients are the same as on the server, but the user names are different.

When I try using gid=,uid= in the /etc/fstab I get mount.nfs: an incorrect mount option was specified. messages in /var/log/messages are

nfsidmap[12817]: nss_getpwnam: name 'apprepo' not found in domain 'sagrid.ac.za'

apprepo is the user name which owns the files on the server. sagrid.ac.za is of course the domain of our machines.

Bruce Becker
  • 277
  • 1
  • 4
  • 18
  • As somewhat explained in this [related answer](http://serverfault.com/a/713659/37681) nfs4 no longer relies on uid and gid *numbers* but uses user and group *names* and since those are different between your nfs server and client you need to create a mapping in idmapd – HBruijn Sep 12 '15 at 07:05
  • Hi @HBruijn, and thanks for the input. Yes, this idmapd configuration was (and still is) my problem. I was not able to translate the documentation into a working configuration. Since I'm not using NIS or KRB, I wasn't sure how to write the rpcidm configuration file to say something like : - turn _this name_ on the remote machine into _this name_ on the server. I have _not_ resolved this yet, but reverted to NFS3. Since I only have 2 machines I don't think performance won't be an issue... but I would still like to have a working NFS4 confg. – Bruce Becker Sep 13 '15 at 07:36

1 Answers1

1

you can enforce nfs client and server to use numeric ids by

echo Y > /sys/module/nfs/parameters/nfs4_disable_idmapping

on the client and server

kofemann
  • 4,308
  • 1
  • 21
  • 27
  • I did try this, but got the error `nfsidmap[12817]: nss_getpwnam: name 'apprepo' not found in domain 'sagrid.ac.za'` There is clearly something wrong with the config, but in a different part. Basically, how do I add the right name to the right domain ? – Bruce Becker Sep 13 '15 at 07:45
  • id you restart the client? It may sill have cached values – kofemann Sep 14 '15 at 13:32