Define remote mountpoints for NFS mount requests





The exports file defines remote mountpoints for the NFS mount protocol according to the NFS server specification; see RFC 1094 (Network File System Protocol Specification) and RFC 1813 (NFS Version 3 Protocol Specification).

Note: There isn't a default version of this file; you can create your own if you need it.

Each line in the file specifies one remote mountpoint. The first field contains the mountpoint directory path, followed optionally by a list of options and/or a list of specific hosts separated by whitespace. If no specific hosts are specified, the mountpoint is exported to all hosts.

Here are the export options:

-mask=netmask -match=network
Restrict access to hosts belonging to subnet defined by netmask and network. By default, there's no restriction. Access is determined by:
((client_ip & netmask) == network)
Don't check incoming requests, they're from a reserved port. By default, NFS requests from ports greater than IPPORT_RESERVED are replied to with EACCES.
Export the filesystem as read-only. By default, the filesystem is exported as read/write.
Map root's uid (real user ID). By default, root is mapped to -2.

Let's now look at a sample file:

/usr -root=1 rickers snowhite.cis.uoguelph.ca
/u -root=5 -mask= -match=
/u2 -ro -mask= -match= node11 node23

The above example specifies the following:

This mountpoint: Is exported:
/usr To hosts rickers and snowhite.cis.uoguelph.ca only, with root mapped to 1 and with read/write access.
/usr/local To host only, with root mapped to -2 and with read/write access.
/u To all hosts within to, with root mapped to 5 and with read/write access.
/u2 To hosts node11 and node23 and to hosts belonging to IP network 10 only, with root mapped to -2 and with read-only access.


Based on: