Linux – Files mounted over NFSv4 are owned by 4294967294, UIDs and GIDs match

linuxnfspermissions

I have two identical linux machines (identical images launched in amazon EC2) and I am trying to mount an exported directory over NFSv4. Here is what the mounted directory looks like on the client machine:

root@server:~# ls -l /websites/
drwxr-xr-x  6 4294967294 4294967294   92 2010-01-01 20:21 logs
drwxr-xr-x  2 4294967294 4294967294   20 2009-12-23 01:14 monit.d
...

I double checked to make sure that the UIDs were matching

Here is the mount command I run from the client

/sbin/mount.nfs4 $MASTER_DN:/ /websites -o rw,_netdev,async

And here is the /etc/exports entry on the server machine:

/websites 10.0.0.0/8(fsid=0,no_subtree_check,rw,no_root_squash)

Best Answer

read here http://blather.michaelwlucas.com/archives/796

If the NFSv4 client and server domain names doesn’t match,all the usernames will show up as “nobody.”

  1. edit /etc/idmapd.conf and set Domain on server and client to the "localdomain"

    [General]

    Domain = localdomain

    [Translation]

    Method = nsswitch

  2. change the /etc/default/nfs-common file (on both your server and client): set NEED_IDMAPD= yes

  3. start idmapd service