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

I am working in a lab with three Ubuntu systems, and I would like to cross-mount some filesystems via NFS. However, while the systems have some of the same usernames, the UIDs and GIDs don't match, because the three systems were set up separately. When I mount an NFS filesystem from one system to another, the ownership shows up wrong. For example, if UID 1000 is alice on server1 and the same UID, 1000, is bob on server2, then when server1 mounts server2's exported filesystem, bob's files appear to be owned by alice.

So Is there any way to make NFS (v4) convert UID's between servers via their associated user names? Googling for this, I've seen lots of references to Kerberos, LDAP, or NIS, which seems like massive overkill for such a simple task, and might not be possible since these systems are not centrally-managed. This link seems to indicate that what I ask is impossible. Is it correct?

Edit: I've tried every configuration for /etc/idmapd.conf that I can think of or find on the internet, and while the idmapd process is clearly running, so far I have not seen any evidence that NFS is making any attempt to use it at all, and it has never had any effect whatsoever on the user ID's reported on NFS mounts.

share|improve this question
I believe that the easiest thing for you is to bring all your stuff in order. You may stay with your current auth scheme as you have only three boxes, but you need to sync all users UIDs/GIDs across your boxes. this is not a difficult task actually. – Serge Sep 22 '12 at 17:57
Yes, that is what I finally ended up doing. – Ryan Thompson Sep 24 '12 at 23:28
up vote 2 down vote accepted

With no centralized user administration, the "best" way I see is for you to force all servers to use the same GID and UID for each user. Now ... I'm only talking about files and/or directories.

What I would do in this case is:

  • Register each UID and GID currently in use.
  • Edit /etc/passwd and /etc/group and match the groups on all servers. Preferably to new UIDs and GIDs so the next step will be faster
  • Run this (it will take some time):

    find / -group <OLD_GID> -exec chgrp <NEW_GID> '{}' \+
    find / -user  <OLD_UID> -exec chown <NEW_UID> '{}' \+
share|improve this answer
Ummm, the "find" statement is starting from the root directory. The command is changing the ownership of every directory on the system. The suggested changes to these commands will include every file on the system. I suggest you limit which directories this command runs against or you will have a very bad day. – user57226 Jan 20 '14 at 20:05
From find man: -group gname True if the file belongs to the group gname. If gname is numeric and does not appear in the group(4) database, it is taken as a group ID. – BitsOfNix Jan 21 '14 at 9:41

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.