Objective 4: Properly Manage the NFS and Samba Daemons

Networked file and printer sharing is among the fundamental services offered by Linux and other operating systems. For years, the standard file sharing protocol for Unix has been the NFS. Originally developed by Sun Microsystems, NFS has been implemented on many operating systems and is available in both commercial and free software implementations.

NFS

Any Linux system may act as both an NFS server and an NFS client. Clients use mount to attach remote filesystems from NFS servers to their local filesystem. Once mounted, the directory hierarchy mounted on the client appears to users as a local filesystem.

Exporting (sharing) local filesystems using NFS

To share a part of your system's filesystem, you must add a specification to /etc/exports. Each line in this file describes a shared filesystem resource. The format of the file is:

directory   system(options) system(options) ...
            

Tip

The syntax of /etc/exports on Linux differs significantly from the same file on systems using a Sun-derived NFS implementation.

directory is a local filesystem directory, such as /home. Each of the space-separated systems describes clients by name or address, and the associated options control access. If the system name is omitted, no restriction is placed on which clients can connect. Typical options are:

ro

Export with read-only attribute.

rw

Export with read/write attribute, the default.

no_root_squash

Allow access by user ID 0, root. Normally ...

Get LPI Linux Certification in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.