Quantcast
Channel: Active questions tagged mount+fstab - Ask Ubuntu
Viewing all articles
Browse latest Browse all 699

How to set correct ownership in NFS?

$
0
0

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

Viewing all articles
Browse latest Browse all 699

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>