I have a server with NFSv4. I am mounting contents of the home folder of remote user to local host. Able to read and write contents, but when I am checking ownership of files at the mounted volume from the local host, they all belongs to corresponding remote user and group (512). Is there any way to make it look like they belong to the local user and group (1000) on the local host?
/etc/exports on remote host (IP is 192.168.1.110)
/home/user512 192.168.1.142(rw,sync,all_squash,anonuid=512,anongid=512)
/etc/fstab on local host (IP is 192.168.1.142)
192.168.1.110:/home/user512 /home/localuser/projects/project512 nfs rw,hard,intr,rsize=32768,wsize=32768 0 0
This is what idmapping is suppose to do. First of all, enable is on the client and server:
clean idmap cache and restart idmap daemon:
Now on server and the client will send instead of numeric IDs string principals like [email protected]. You need to have bob account on the both hosts - client and server. Nevertheless, the numeric ID's can be different.
You have all the pieces there. From the exportfs man page,
all_squash
maps all uids and gids to the anonymous versions. What you wrote forced those values to be 512. If you changed to 1000, the nfs server on the remote host would make everything 1000, and access should be granted.on your nfs client, edit /etc/idmapd.conf and change
afther this restart the nfs service
I was able to fix
nobody:nobody
ownership issue over NFS on CentOS 6 (server) + 7 (client) with two changes:/etc/idmapd.conf
Domain
parameter is the same on server and clientthen on the client
and remount shares if necessary