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,
/misc/export speedy.example.com(sync)
would allow users from speedy.example.com to mount /misc/export with the default read-only permissions, but,
/misc/export speedy.example.com(rw,sync)
would allow users from speedy.example.com to mount /misc/export with read/write privileges.
Refer to Section 21.6.4, “Hostname Formats” for an explanation of possible hostname formats.

Warning

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 speedy.example.com(rw,sync) /misc/export speedy.example.com (rw,sync)
The first line grants users from speedy.example.com read-write access and denies all other users. The second line grants users from speedy.example.com 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