The exports file specifies remote mount points for the NFS mount protocol per the NFS server specification; see "Network File System Protocol Specification", RFC1094, Appendix A and "NFS: Network File System Version 3 Specification", Appendix I.
Each line in the file (other than comment lines that begin with a #) specifies the mount point(s) and export flags within one local server file system for one or more hosts. A long line may be split over several lines by ending all but the last line with a backslash (\). A host may be specified only once for each local file system on the server and there may be only one default entry for each server file system that applies to all other hosts. The latter exports the file system to the world and should be used only when the file system contains public information.
In a mount entry, the first field(s) specify the directory path(s) within a server file system that can be mounted on by the corresponding client(s). There are two forms of this specification. The first is to list all mount points as absolute directory paths separated by whitespace. The second is to specify the pathname of the root of the file system followed by the -alldirs flag; this form allows the host(s) to mount at any point within the file system, including regular files if the -r option is used on mountd(8). The pathnames must not have any symbolic links in them and should not have any "." or ".." components. Mount points for a file system may appear on multiple lines each with different sets of hosts and export options.
The second component of a line specifies how the file system is to be exported to the host set. The option flags specify whether the file system is exported read-only or read-write and how the client uid is mapped to user credentials on the server.
Export options are specified as follows:
.Sm off -maproot = user
.Sm on The credential of the specified user is used for remote access by root. The credential includes all the groups to which the user is a member on the local machine (see id(1)). The user may be specified by name or number.
.Sm off -maproot = user:group1:group2:...
.Sm on The colon separated list is used to specify the precise credential to be used for remote access by root. The elements of the list may be either names or numbers. Note that user: should be used to distinguish a credential containing no groups from a complete credential for that user.
.Sm off -mapall = user
.Sm on or
.Sm off -mapall = user:group1:group2:...
.Sm on specifies a mapping for all client uids (including root) using the same semantics as -maproot .
The option -r is a synonym for -maproot in an effort to be backward compatible with older export file formats.
In the absence of -maproot and -mapall options, remote accesses by root will result in using a credential of -2:-2. All other users will be mapped to their remote credential. If a -maproot option is given, remote access by root will be mapped to that credential instead of -2:-2. If a -mapall option is given, all users (including root) will be mapped to that credential in place of their own.
The -ro option specifies that the file system should be exported read-only (default read/write). The option -o is a synonym for -ro in an effort to be backward compatible with older export file formats.
WebNFS exports strictly according to the spec (RFC 2054 and RFC 2055) can be done with the -public flag. However, this flag in itself allows r/w access to all files in the file system, not requiring reserved ports and not remapping uids. It is only provided to conform to the spec, and should normally not be used. For a WebNFS export, use the -webnfs flag, which implies -public ,
.Sm off -mapall = nobody
.Sm on and -ro . Note that only one file system can be WebNFS exported on a server.
.Sm off -index = file
.Sm on option can be used to specify a file whose handle will be returned if a directory is looked up using the public filehandle (WebNFS). This is to mimic the behavior of URLs. If no -index option is specified, a directory filehandle will be returned as usual. The -index option only makes sense in combination with the -public or -webnfs flags.
Specifying the -quiet option will inhibit some of the syslog diagnostics for bad lines in /etc/exports. This can be useful to avoid annoying error messages for known possible problems (see EXAMPLES below).
The third component of a line specifies the host set to which the line applies. The set may be specified in three ways. The first way is to list the host name(s) separated by white space. (Standard Internet dot addresses may be used in place of names.) The second way is to specify a netgroup as defined in the netgroup file (see netgroup(5)). The third way is to specify an Internet subnetwork using a network and network mask that is defined as the set of all hosts with addresses within the subnetwork. This latter approach requires less overhead within the kernel and is recommended for cases where the export line refers to a large number of clients within an administrative subnet.
The first two cases are specified by simply listing the name(s) separated by whitespace. All names are checked to see if they are netgroup names first and are assumed to be hostnames otherwise. Using the full domain specification for a hostname can normally circumvent the problem of a host that has the same name as a netgroup. The third case is specified by the flag
.Sm off -network = netname
.Sm on and optionally
.Sm off -mask = netmask.
.Sm on If the mask is not specified, it will default to the mask for that network class (A, B or C; see inet(4)). See the EXAMPLES section below.
The mountd(8) utility can be made to re-read the exports file by sending it a hangup signal as follows:
kill -s HUP cat /var/run/mountd.pid
After sending the SIGHUP, check the syslogd(8) output to see whether mountd(8) logged any parsing errors in the exports file.