Installation guide

The /etc/exports Configuration File
69
export host1(options1) host2(options2) host3(options3)
For information on different methods for specifying hostnames, refer to Section 10.6.4, “Hostname
Formats”.
In its simplest form, the /etc/exports file only specifies the exported directory and the hosts
permitted to access it, as in the following example:
/exported/directory bob.example.com
Here, bob.example.com can mount /exported/directory/ from the NFS server. Because no
options are specified in this example, NFS will use default settings, which are:
ro
The exported file system is read-only. Remote hosts cannot change the data shared on the file
system. To allow hosts to make changes to the file system (i.e. read/write), specify the rw option.
sync
The NFS server will not reply to requests before changes made by previous requests are written to
disk. To enable asynchronous writes instead, specify the option async.
wdelay
The NFS server will delay writing to the disk if it suspects another write request is imminent.
This can improve performance as it reduces the number of times the disk must be accesses
by separate write commands, thereby reducing write overhead. To disable this, specify the
no_wdelay; note that no_wdelay is only available if the default sync option is also specified.
root_squash
This prevents root users connected remotely from having root privileges; instead, the NFS server
will assign them the user ID nfsnobody. This effectively "squashes" the power of the remote root
user to the lowest local user, preventing possible unauthorized writes on the remote server. To
disable root squashing, specify no_root_squash.
To squash every remote user (including root), use all_squash. To specify the user and group IDs
that the NFS server should assign to remote users from a particular host, use the anonuid and
anongid options, respectively, as in:
export host(anonuid=uid,anongid=gid)
Here, uid and gid are user ID number and group ID number, respectively. The anonuid and
anongid options allow you to create a special user/group account for remote NFS users to share.
Important
By default, access control lists (ACLs) are supported by NFS under Red Hat Enterprise Linux. To
disable this feature, specify the no_acl option when exporting the file system.
Each default for every exported file system must be explicitly overridden. For example, if the rw option
is not specified, then the exported file system is shared as read-only. The following is a sample line
from /etc/exports which overrides two default options:
/another/exported/directory 192.168.0.3(rw,async)