Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

21.6.2. Command Line Configuration

If you prefer editing configuration files using a text editor or if you do not have the X Window System installed, you can modify the configuration file directly.
The /etc/exports file controls what directories the NFS server exports. Its format is as follows:
directory hostname(options)
The only option that needs to be specified is one of sync or async (sync is recommended). If sync is specified, the server does not reply to requests before the changes made by the request are written to the disk.
For example,
would allow users from to mount /misc/export with the default read-only permissions, but,
would allow users from to mount /misc/export with read/write privileges.
Refer to Section 21.6.4, “Hostname Formats” for an explanation of possible hostname formats.


Be careful with spaces in the /etc/exports file. If there are no spaces between the hostname and the options in parentheses, the options apply only to the hostname. If there is a space between the hostname and the options, the options apply to the rest of the world. For example, examine the following lines:
/misc/export,sync) /misc/export (rw,sync)
The first line grants users from read-write access and denies all other users. The second line grants users from read-only access (the default) and allows the rest of the world read-write access.
Each time you change /etc/exports, you must inform the NFS daemon of the change, or reload the configuration file with the following command:
service nfs reload