NFS share per-host permissions

Two step process:

  1. Create the share with 192.168.0.100 as the host entry. This will create a RW entry for that host in /etc/exports.
  2. Create another share entry for the same path with 192.168.0.0/24 as the network entry. Select Advanced Options and check the Read Only checkbox.

This should give you the desired access. Note, that NFS uses ‘first match’ from /etc/exports. So, make sure to create the RW entry first.

If you follow the order above your /etc/exports should look like:

"/mnt/tank/nfs_dataset"\
        192.168.0.100(sec=sys,rw,no_subtree_check)
"/mnt/tank/nfs_dataset"\
        192.168.0.0/24(sec=sys,no_subtree_check)
3 Likes