Allow Connection to NAS
Before you begin to config, remember to enable NFS service in [Services] or some of the settings below won’t show up.
First, you need to check available shared folders in [Access Control] →[Shared Folders]. Use [Add] button to create or select the folder you want to share via NFS.
Then click [Access Rights] button to bring up Edit Shared Folder Privileges dialog. Use [NFS Privileges] tab to create a new or [Edit] button to edit existing shared folder. Remember to enable Allow connections from non-reserved ports (ports greater than 1024) which will generate insecure as a parameter in exports which is a NFS configuration file. According to Using Linux NFS with Other OSes on nfs.sourceforge.net, insecure will enable listening to ports higher than 1024. Because non-root users can bind ports above 1024, it’s less secured.
For example, if you want all IP between 192.168.1.1 to 192.168.1.254 with the same permission, use 192.168.1.1/24. Another is all IP between 192.168.1.5 to 192.168.1.6 with the same permission, use 192.168.1.5/29. Netmask on Computer Hope is a very detail explain and IP Calculator by Krischan Jodies may calculate for you.
Last, choose root Mapping as root(0).
Here is an generated exports configuration to share a folder name Public on 192.168.2.*:
With this configuration, folders created on Linux and OS X are different owner and groups. What’s created on OSX can be seen on Linux but no read nor write priviledge. For those created on Linux, OSX can see and read but not write.
root@AS5102T:/volume1/Public # ls -l total 8 drwxr-xr-x 2 1000 users 4096 May 3 16:10 Linux/ drwxr-xr-x 2 501 20 4096 May 3 16:05 Mac/
File Permission and Squash Option
Because I want to have full access on files and folders on ADM, I have to edit /etc/exports and change no_root_squash into all_squash.
To apply this manual change, use exportfs -ra to reload export configuration as explained in Fix NFS privileges on Synology NAS on Linux and Unit tips. Or you may disable and then enable NFS service again in [Services] →[NFS].
root@AS5102T:/volume1/Public # exportfs -ra root@AS5102T:/volume1/Public # ls -l total 8 drwxr-xr-x 2 admin administ 4096 May 3 16:43 Linux/ drwxr-xr-x 2 admin administ 4096 May 3 16:42 Mac/ admin@AS5102T:/volume1/Public $ exportfs -ra exportfs: could not open /var/lib/nfs/.etab.lock for locking: errno 13 (Permission denied) exportfs: can't lock /var/lib/nfs/etab for writing
Mount the Right Path
Here is an example to mount a shared folder Public at 192.168.1.10 with Finder:
- About.com: Linux / Unix Command: exports
- Apple: OS X
- Apple: OS X Man Pages: EXPORTS(5)
- Apple: Support: Mac Basics: The Finder organizes all of your files
- Asustor ADM
- Christian Schneider: HOWTO setup a small server: NFS Server (Network File System)
- Computer Hope: Netmask
- Facebook: QNAP Geek
- Krischan Jodies: IP Calculator
- Linux and Unix tips: Fix NFS privileges on Synology NAS
- nfs.sourceforge.net: 3. Setting Up an NFS Server
- nfs.sourceforge.net: 8. Using Linux NFS with Other OSes
- StackExchange: Unix & Linux: How to configure a fixed user ID on an NFS server?
- Tech Republic: Mounting NFS volumes in OS X
- You Mac / Linux Guy: Automount NFS in OS X
- Wiki: Internet Protocol
- Wiki: Lightweight Directory Access Protocol
- Wiki: Network File System
- 鳥哥的 Linux 私房菜： 第十三章、檔案伺服器之一：NFS 伺服器
- 鳥哥的 Linux 私房菜： 何為同一網段之 IP ，及 netmask 的定義與切割子網的方法說明