2

I try to setup NFS access on my Synology NAS. For historical reasons the uid on my client and my server do not match. I understood that NFSv4 could allow me to elegantly solve this issue, to the price of understanding how to use idmap (although, it does not seem to work that well on Synology NAS: mount-synology-nfsv4-export-with-id-mapping).

Anyway, I was happy enough with the solution proposed by suprjami at user-id-mapping-with-nfs-on-synology-nas (and I found several other places on the web describing the same technique) which consists in using all_squash option to map any user on the client to a given user on the server. The only possibility provided by the graphical user interface of the NAS is to map to a user called admin that has uid=1024.

This works fine:

NAS-192.168.0.2 # cat /etc/exports
/volume1/photo  192.168.0.10(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)

On my client laptop with IP 192.168.0.10:

laptop-192.168.0.10 # mount 192.168.0.2:/volume1/photo /mnt/nas
laptop-192.168.0.10 # ls -l /mnt
drwxrwxrwx  5 root root 4096 juin  22 17:08 nas

I can list, read and write files in /mnt/nas and everything is creddited to user 1024, as expected.

Now, my problem: I would like to map not to admin but to my local user on the NAS, which has user id 1026 as can be checked on the NAS:

NAS-192.168.0.2 # id infisxc
uid=1026(infisxc) gid=100(users) groups=100(users)

So, I simply change the anonuid value on /etc/exports on the server:

NAS-192.168.0.2 # cat /etc/exports
/volume1/photo  192.168.0.10(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1026,anongid=100)
NAS-192.168.0.2 # exportfs -ra

Now, on the client side, the mount still succeeds but with no permission at all:

laptop-192.168.0.10 # mount 192.168.0.2:/volume1/photo /mnt/nas
laptop-192.168.0.10 # ls -l /mnt
d---------  5 root root 4096 juin  22 17:08 nas

And unsurpisingly, I cannot list the content of the folder.

It seems to me that I am doing all right, but I might be forgetting something. Any advise would be welcome.

Just to be complete, I have a DS414j NAS from Synology with DSM 6.1.2-15132.

infisxc
  • 81
  • 2
  • 6

0 Answers0