NFS Server Configuration
You can configure the NFS server by editing the /etc/exports file. This
file is similar to the /etc/fstab file in that it is used to set the permissions
for the file systems being exported. The entries look like this:
Click here to view code image
/file/system yourhost(options) *.yourdomain.com(options)
192.168.0.0/24(options)
This shows three common clients to which to share /file/system. The
first, yourhost, shares /file/system to just one host. The second,
.yourdomain.com, uses the asterisk (*) as a wildcard to enable all hosts in
yourdomain.com to access /file/system. The third share enables all hosts
of the Class C network 192.168.0.0 to access /file/share. For security, it
is best not to use shares such as the last two across the Internet because all
data will be readable by any network the data passes by.
Table 23.1 shows some common options.
Table 23.1 /etc/fstab Options
OptionPurpose
rw Gives read and write access
ro Gives read-only access
asyncWrites data when the server, not the client, feels the need
sync Writes data as it is received
The following is an example of an /etc/exports file:
Click here to view code image
/etc/exports: the access control list for filesystems which may be
exported
to NFS clients. See exports(5).
/home/matthew 192.168.0.0/24(rw,no_root_squash)
This file exports (makes available) /home/matthew to any host in
192.168.0.* and allows users to read from and write to
/home/matthew.
After you have finished with the /etc/exports file, the following