I have a server (Ubuntu 20.04) with NFS server. I want to share the /home/user for each user. However, on the client (Ubuntu 18.04), ids are usually different from the one on the server leading to ownership issues.
The /etc/exports looks like
/home/user2 10.4.200.2(rw,sync,all_squash,anonuid=1002,anongid=1002)/home/user3 10.4.200.3(rw,sync,all_squash,anonuid=1003,anongid=1003)...
with
$ id user2uid=1002(user2) gid=1002(user2) groups=1002(user2)$ id user3uid=1003(user3) gid=1003(user3) groups=1003(user3)
On the clients, id will be for example
$ id user2uid=1001(user2) gid=1001(user2) groups=1001(user2)
In the fstab, I added the following line
10.4.200.2:/home/user2 /home/user2/server nfs rw 0 0
After mount the folder (mount -a), the ownership does not match
$ ls -l | grep serverdrwxr-xr-x 32 1002 1002 4096 sept. 3 11:32 server$ cd server/$ touch footouch: cannot touch 'foo': Permission denied