Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

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 ?

share|improve this question

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

Or synchronize userids using NIS, LDAP, etc.

share|improve this answer
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
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 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.