
Overview of NIS | 29
Sys Admin
Overview
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Exporting Filesystems
To set up an NFS server, first check that all the hosts that will mount your file-
system can reach your host. Next, edit the /etc/exports file on the server. Each
entry in this file indicates the name of a directory to be exported, domain names
of machines that will have access to that particular mount point, and any options
specific to that machine. A typical entry looks like:
/projects hostname1(rw) hostname2(ro)
If you are running mountd, the files will be exported as allowed by the permis-
sions in /etc/exports. See the exports manpage for all available export options.
Mounting Filesystems
To enable an NFS client, mount a remote filesystem after NFS is started, either by
using the mount command or by specifying default remote filesystems in /etc/
fstab. For example:
# mount servername:/projects /mnt/nfs/projects
A mount request calls the server’s mountd daemon, which checks the access
permissions of the client and returns a pointer to a filesystem. Once a directory is
mounted, it remains attached to the local filesystem until it is unmounted with the
umount command or until the local system is rebooted.
Usually, only a privileged user can mount filesystems with NFS. However, you
can enable users to mount and unmount selected ...