I have read access only to the mounted NFS share.
With 'no squash mapping' set on the NAS, Ubuntu regular user gets Permission denied when trying to cd into the share and can only get read access by using sudo.
Using squash 'map all users to admin' setting, client regular user can cd into and has only read access to the share. Using sudo does not allow writing.
Synology NAS:
DS214> id username
uid=1026(username) gid=100(users) groups=100(users),101(administration)
No squash (no mapping)
DS214> cat /etc/exports
/volume1/Files 10.1.1.2(rw,async,no_wdelay,no_root_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100) `
All squash (map all users to admin)
DS214> cat /etc/exports
/volume1/Files 10.1.1.2(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)`
Ubuntu client:
$ cat /etc/fstab
10.1.1.214:/volume1/Files /mnt/nfs/Files nfs rw,user,auto 0 0
$ id username
uid=1000 gid=1000(username) groups=1000(username), <etc>
$ ls -n /mnt/nfs
drwxrwxrwx 9 0 0 4096 Sep 25 01:28 Files
$ ls -n /mnt/nfs/Files
drwxr-xr-x 11 1026 100 4096 Sep 24 22:05 Data
(I originally posted in error that using sudo enabled write access) I can open a file in the mounted NFS share with sudo vi /mnt/nfs/Files/Data/test.file but cannot write the changes to the file even with sudo. The vi Error message upon :w! command is:
"test.file" E212: Can't open file for writing`
id username) do they belong to and which permissions are set? – Nephente Sep 24 '15 at 15:33cdinto the mount as a regular user? If yes, I suggest the following. To confirm or rebut my suspicion, do the following: On the clientcdinto the mount and dols -n. That will list file owners and groups with their respective IDs. You will have to do that withsudoI guess. Append a line or two of the output to your question, along with the output ofid(nosudo!)If you can't even
– Nephente Sep 24 '15 at 15:58cdto the mount as a regular user, you will have to check the permissions of the dir you're exporting on the server.cdinto the mount as a regular user. Using Squash on the server to force permissions works as a temporary fix to grant permissions. Investigating server permissions andid username. – marsilea Sep 24 '15 at 17:04/mnt/nfs/Files. AlthoughFilesbelongs toroot, permission allow anyone to do anything. It makes no sense to me why you'd have trouble entering that dir as any user. Maybe post the relevant line from/etc/exports? – Nephente Sep 25 '15 at 06:29/mnt/nfs/Fileswithsudo mkdirso it still belongs to root - not sure if that is correct methodology - I'm still an Ubuntu/Linux beginner. – marsilea Sep 25 '15 at 07:08all_squash. Being not able to write is expected, because you squash toanongid 100. This group hasr-xpermissions. Withall_squash, even root and hencesudowill adopt this GID. I think you made a typo, it should rather beanonid=1026than1024...? – Nephente Sep 25 '15 at 09:41anonuid=1025forno_root_squash;anonuid=1024forall_squash. The typo was only in omitting the 'u' inanonuid. – marsilea Sep 25 '15 at 09:53UID 102*6*, so all you get are the group permissions. – Nephente Sep 25 '15 at 09:55all_squashandanonuid=1026(not 1025) for the export. Re-export withsudo exportfs -ar, and remount client-side and see if you have write access then. – Nephente Sep 25 '15 at 15:39/etc/exports. I rebooted it and the exports value remained changed. Now I can write files and change permissions of files within the NAS as if logged in via ssh or browser interface. As I am the only user at the moment, I think I'll use it as it is now withall_squashset. Thank you! – marsilea Sep 27 '15 at 14:25