• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Solaris : How To Create and Mount NFS share that is Restricted to Certain Hosts

by admin

For Solaris 10

On NFS server
Run the below command to share the NFS to specific NFS clients only.

# share -F nfs -o rw=[accesslist] /path/to/share

The -o accesslist is required to limit the share. As shown in example below “client1″ and client2” has only been granted the access to the NFS share /exports :

# share -F nfs -o rw=client1,client2 /export

The access list may contain netgroups, FQDN, IP addresses (of networks or hosts) depending on what name resolution you are using. Typically, share commands are entered in the /etc/dfs/dfstab file for execution at boot.

On NFS client
For Solaris NFS clients, simply execute the mount command as you would normally. If the host, network or domain (whichever you are using for accesslist) matches, the mount will be allowed. If there is no match, access will be denied and the mount will fail.

# mount -F nfs -o [options] [NFS_server]:[mountpoint]

For Soalris 11 without ZFS

On the NFS server
Do not populate /etc/dfs/dfstab, it is deprecated in Solaris 11. Use the share command:

# share -F nfs -d sharetest -o rw=client1,client2 /export
# showmount -e
export list for nfsserverhost:
/export          client1,client2

Solaris 11.1 or later – with ZFS version 6 (or later)

Solaris 11 ZFS shares are done in two steps:
1. Create the share, assigning name=[sharename] value to the dataset’s share name property:

# zfs set share=name=myshare,path=/export,prot=nfs mypool/export

2. Publish the share, configuring the access list, via the share.nfs.sec.default.rw (assuming R/W access is to be limited) property.

# zfs set share.nfs.sec.default.rw=client1:client2 mypool/export%myshare

This configures the read/write client access list – for the client1 and client2 hosts in this case.

On the NFS client
Use the mount command:

# mount -F nfs -o [options] [NFS_server]:[mountpoint]

Filed Under: Solaris

Some more articles you might also be interested in …

  1. Troubleshooting solaris 10 boot issues related to SMF and milestones
  2. How to measure NIC Performance/Throughput in Solaris 11 using iftop
  3. Unix file basics : Inode, Soft Vs Hard link, Device files, Named pipes
  4. How to save sar reports longer than 7 days in Solaris
  5. How to configure rsyslog on Solaris 11.1 to send messages to a remote host using TCP
  6. Script to reset the iostat errors counters (hard/soft/trn) without reboot
  7. Managing network resources in Solaris 11 using “dlstat” and “flowstat”
  8. Solaris : How to find number of open files by a process
  9. How to configure a vnic on top of a Vlan Tagged Interface and assign the vnic to a Solaris 11 Zone
  10. ZFS destroy error “cannot determine dependent datasets: recursive dependency”

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright