8

I have an established Linux server (Ubuntu 12.04) and a new Synology NAS and am having trouble getting correct NFS user permissions on the mountpoint.

The server also mounts an NFS export from another Ubuntu server without issues, but the UIDs on that NFS server and the client are the same (ranging from 1001 to 1015). In the case of the Synology, UIDs start at 1024.

The following line from /etc/fstab is how Synology and other examples show to configure the mount.

nas:/volume1/Video      /mnt/nas/Video  nfs     nouser,rsize=8192,wsize=8192,atime,auto,rw,dev,exec,suid        0       0

I have configured idmapd.conf as follows:

[General]
Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
# set your own domain here, if id differs from FQDN minus hostname
Domain = SYNOLOGY

[Mapping]
Nobody-User = nobody
Nobody-Group = nogroup

[Static]
homenas@SYNOLOGY = homenas

At this point when I mount the folder, everything looks correct until I create a file. The file is owned by nobody.nogroup, but I'm still able to make changes to it.

$ id
uid=1002(homenas) gid=1002(homenas) groups=1002(homenas)
$ pwd
/mnt/nas/Video
$ ls -l test
ls: cannot access test: No such file or directory
$ touch test
$ ls -l test
-rw-rw-r-- 1 nobody nogroup 0 Dec 24 15:30 test
$ rm test

How do I correctly mount an NFS share and retain the correct user permissions when the UIDs do not match, and enforce those permissions?

1
  • I had to change the user id's to match. I think I changed my ubuntu to match the synology. So on the synology I did "id nfs-user" and changed my "nfs-user" on ubuntu to have the same user and group id's. then it talks right Feb 25, 2017 at 12:29

2 Answers 2

2

Add nfsvers=3 to /etc/fstab.

nas:/volume1/Video      /mnt/nas/Video  nfs     nfsvers=3,nouser,rsize=8192,wsize=8192,atime,auto,rw,dev,exec,suid        0       0

The problem only occurs with NFS version 4, if you specify that you want NFS version 3, that solves the problem.

1
  • This solved the issue for me, but it would be nice to know why it solved it... Jul 15, 2014 at 18:10
0

I still have no good answer to this. Short of deploying NIS in the environment, there doesn't seem to be a good way make multi-user NFS feasible on Synology.

In the meantime, I have resorted to using CIFS, so I can mount a share in a nested mountpoint where I can use local group permissions for access control. Using CIFS authentication keeps ownership consistent with a single user on the Synology device, but permissions are still wonky.

The line in /etc/fstab uses mostly default settings:

//nas/media     /mnt/nas/media  cifs    uid=ubuntuuser,gid=ubuntugroup,rw,credentials=/etc/cifspwd,_netdev   0       0

In this case, the parent folder to the mount point (/mnt/nas) controls access into the mountpoint (/mnt/nas/media), where all files are otherwise mode 0777.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.