old-www/LDP/lame/LAME/linux-admin-made-easy/nfs-services.html

288 lines
5.0 KiB
HTML

<HTML
><HEAD
><TITLE
>Network File System (NFS) Services</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="Linux Administration Made Easy"
HREF="index.html"><LINK
REL="UP"
TITLE="Custom Configuration and Administration Issues"
HREF="custom-config.html"><LINK
REL="PREVIOUS"
TITLE="Macintosh-style File and Print Services with Netatalk"
HREF="netatalk-file-and-print.html"><LINK
REL="NEXT"
TITLE="Configuration from A-Z with Linuxconf"
HREF="linuxconf.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux Administration Made Easy</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="netatalk-file-and-print.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 7. Custom Configuration and Administration Issues</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="linuxconf.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="NFS-SERVICES"
>7.6. Network File System (NFS) Services</A
></H1
><P
>Linux can act as both client and server for file systems shared
using the Network File System (NFS) protocol, which is the defacto
standard for providing file system mounts among Unix systems.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Note: Please be aware that having an NFS service available on
your system can be a security risk. Personally, I don't recommend using
it.</P
></BLOCKQUOTE
></DIV
><P
>In order to use NFS, you will need to ensure that NFS support has
been included in your kernel or kernel modules. See
<A
HREF="linux-kernel-upgrades.html"
>Section 10.4</A
> for details on how to upgrade or
customize the Linux kernel.</P
><P
>NFS shares are configured by modifying the
``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/etc/exports</TT
></TT
>'' file. Here are some
example entries, showing some of the options available:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>/archive spock.mydomain.name(ro)
/archive2 spock.mydomain.name(ro)
/mnt/cdrom other.domain(ro)
/archive2 10.23.14.8(ro,insecure) </PRE
></TD
></TR
></TABLE
><P
>The first couple of lines allow the host, ``spock.mydomain.name''
access to both the ``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/archive</TT
></TT
>''
as well as the ``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/archive2</TT
></TT
>''
directories via NFS. These shares are made available read-only with the
``<TT
CLASS="LITERAL"
>(ro)</TT
>'' option. For security reasons, it is a good
idea to do this for all of your NFS shares if at all possible.</P
><P
>The third line will allow any host in the ``domain.name'' domain
name space to access the CD-ROM drive. Of course, it is necessary to
mount the CD-ROM device to ``<TT
CLASS="LITERAL"
>/mnt/cdrom</TT
>'' first.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Note: Using the ``<TT
CLASS="LITERAL"
>(ro)</TT
>)'' option to mark this
device read-only may seem a bit redundant, however doing so will prevent a
miscreant from writing to a real file system should the CD-ROM device not
be mounted.</P
></BLOCKQUOTE
></DIV
><P
>After you have made changes to the
``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/etc/exports</TT
></TT
>'' file, you will
need to restart the NFS daemon. To do so, type:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
><TT
CLASS="USERINPUT"
><B
>/etc/rc.d/init.d/nfs restart</B
></TT
></PRE
></TD
></TR
></TABLE
><P
>You can also configure your NFS mount points with the
``<TT
CLASS="LITERAL"
>Network Configurator</TT
>'' tool included in the
``<TT
CLASS="LITERAL"
>Linuxconf</TT
>'' utility. For more information on the
Linuxconf utility, see <A
HREF="linuxconf.html"
>Section 7.7</A
>.</P
><P
>More information on NFS can be found in the
``<EM
>NFS-HOWTO</EM
>'' guide at <A
HREF="http://metalab.unc.edu/LDP/HOWTO/NFS-HOWTO.html"
TARGET="_top"
>http://metalab.unc.edu/LDP/HOWTO/NFS-HOWTO.html</A
>, as well as in
the man pages on ``<TT
CLASS="LITERAL"
>nfsd</TT
>'' and
``<TT
CLASS="LITERAL"
>exports</TT
>''.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="netatalk-file-and-print.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="linuxconf.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Macintosh-style File and Print Services with Netatalk</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="custom-config.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Configuration from A-Z with Linuxconf</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>