Scenario: There are different mappings of UIDs and GIDs between hosts that would like to have NFS share.

Is there workaround without changing number mapping on hosts ?


Is there a way to "hardcode" mapping of username/groupname <-> uid/gid. (for example on client side to map local uid 3333 top remote uid 2222 and local gid 999 to remote gid 888 ? )

I know about trick with mapping everyone to "nobody" or making chown uog+rw -R .... I am interested in solution where user UX in group GX creates files and directories as GX and UX and other GY, UY creates as GY UY... maybe some idmapd might be helpful ?

If there is no other option, how to securely change number UID and GID on all those hosts to make them consistent ?


Have a look at the map_static option in /etc/exports.

Or synchronize userids using NIS, LDAP, etc.

  • map_daemon looks very insecure. Also mentioned in that link is map_nis - but map_static is propably the best option in this case. – Nils Apr 15 '12 at 19:43
  • 1
    Sounds great, thanks for reference. Unfortunately in existing installations, "map_static" option is not available exportfs: /etc/exports:2: unknown keyword "map_static=... . I will try it as it will be available. – Grzegorz Wierzowiecki Apr 15 '12 at 20:54
  • That option has been around for a few years, but assumes you're using the userspace NFS daemon. – Mikel Apr 16 '12 at 2:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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