2.6. The /etc/exports configuration file
The /etc/exports file controls which directories the server exports. Each line contains an export point, a whitespace-separated list of clients that are allowed to mount the directory, and options for each of the clients.
The following is the format for an /etc/exports entry:
<directory> <host_or_network_1>(<options_1>) <host_or_network_n>(<options_n>)...
The following are the individual parts of an /etc/exports entry:
- <directory>
- The directory that is being exported.
- <host_or_network>
- The host or network to which the export is being shared. For example, you can specify a hostname, an IP address, or an IP network.
- <options>
- The options for the host or network.
Adding a space between a client and options, changes the behavior. For example, the following lines do not have the same meaning:
/projects client.example.com(rw)
/projects client.example.com (rw)
In the first line, the server allows only client.example.com to mount the /projects directory in read-write mode, and no other hosts can mount the share. However, due to the space between client.example.com and (rw) in the second line, the server exports the directory to client.example.com in read-only mode (default setting), but all other hosts can mount the share in read-write mode.
The NFS server uses the following default settings for each exported directory:
| Default setting | Description |
|---|---|
|
| Exports the directory in read-only mode. |
|
| The NFS server does not reply to requests before changes made by previous requests are written to disk. |
|
| The server delays writing to the disk if it suspects another write request is pending.. |
|
|
Prevents that the |
You can view and manage exported file systems using the exportfs command. For details see the exportfs(8) man page on your system.