0

I am mounting an NFS share (v3, from my Synology NAS) on a FreeBSD 10.1 box. This works (i.e. it does not seem to be a UID/GID issue), but I always get 777 permissions when I mount the share. I need this to be 770.

This is /etc/exports on the NAS:

DataTomb> cat /etc/exports
/volume1/nas_share     192.0.2.1(rw,async,no_wdelay,root_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)

And this is /etc/fstab on the FreeBSD box:

nas.domain.tld:/volume1/nas_share   /var/nas_share   nfs   rw  0   0

Here is the mount point (on FreeBSD) before the share is mounted:

# ll -n /var/
...
drwxrwx---   2 80  100   512B Aug 22 09:38 nas_share
....

The directory nas_share is empty:

# ll -n /var/nas_share/
total 8
drwxrwx---   2 80  100   512B Aug 22 09:38 .
drwxr-xr-x  30 0   0     1.0K Aug 18 22:16 ..

This is what it looks like after the share is mounted:

 # ll -n /var/
...
drwxrwxrwx   5 0   0    4.0K Aug 18 22:34 nas_share
...

And within the directory:

# ll -n /var/nas_share/
total 56
drwxrwxrwx   5 0     0     4.0K Aug 18 22:34 .
drwxr-xr-x  30 0     0     1.0K Aug 18 22:16 ..
-rwxrwxrwx   1 1030  100   284B Aug 18 22:23 .htaccess
...
drwxrwxrwx   5 1030  100   4.0K Aug 18 23:01 user1
...

Where is the rwx for "other" coming from? How can I change this to 770? This should be permanent (i.e. I cannot do this every time the share is mounted).

This is actually pretty close to [1], but the answer to that question seems contradictory to me (first it states that the mount point permissions are not relevant, then it suggests to change the mount point permissions...)

Am I missing something obvious?

[1] Setting NFS mount point directory permissions and owner

scherand
  • 183
  • 9

1 Answers1

1

You probably have to set that on the directory in the NAS.

If your NAS won't let you change it, then you'll have to temporarily replace root_squash with no_root_squash in the options, and then maybe it'll work from NFS...

cd /var/nas_share/
chmod o= .
Peter
  • 2,756
  • 1
  • 20
  • 26