<HTML
><HEAD
><TITLE
>Controlling Access to Services</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.40"><LINK
REL="HOME"
TITLE="Red Hat Linux 6.1"
HREF="index.htm"><LINK
REL="UP"
TITLE="System Administration"
HREF="ch-sysadmin.htm"><LINK
REL="PREVIOUS"
TITLE="Sendmail"
HREF="s1-sysadmin-sendmail.htm"><LINK
REL="NEXT"
TITLE="Anonymous FTP"
HREF="s1-sysadmin-ftp.htm"></HEAD
><BODY
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Red Hat Linux 6.1: The Official Red Hat Linux Reference Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="s1-sysadmin-sendmail.htm"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. System Administration</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="s1-sysadmin-ftp.htm"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="S1-SYSADMIN-ACCESS"
>Controlling Access to Services</A
></H1
><A
NAME="AEN1561"
></A
><A
NAME="AEN1563"
></A
><P
>        As a security measure, most network services are managed by a protective
        program called a <I
CLASS="FIRSTTERM"
>TCP wrapper</I
>.  The protected
        services are those listed in <TT
CLASS="FILENAME"
>/etc/inetd.conf</TT
> that
        specify <TT
CLASS="FILENAME"
>/usr/sbin/tcpd</TT
>.  <B
CLASS="COMMAND"
>tcpd</B
>
        can allow or deny access to a service based on the origin of the
        request, and the configuration in <TT
CLASS="FILENAME"
>/etc/hosts.allow</TT
>
        and <TT
CLASS="FILENAME"
>/etc/hosts.deny</TT
>.
      </P
><A
NAME="AEN1572"
></A
><A
NAME="AEN1574"
></A
><A
NAME="AEN1576"
></A
><P
>        By default Red Hat Linux allows all service requests.  To disable or limit
        services you can edit <TT
CLASS="FILENAME"
>/etc/hosts.allow</TT
>.  Here is an
        example <TT
CLASS="FILENAME"
>/etc/hosts.allow</TT
> file:
      </P
><A
NAME="AEN1581"
></A
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
><TT
CLASS="COMPUTEROUTPUT"
>ALL: redhat.com .redhat.com
in.talkd: ALL
in.ntalkd: ALL
in.fingerd: ALL
in.ftpd: ALL</TT
>
      </PRE
></TD
></TR
></TABLE
><P
>        This configuration allows all connections from redhat.com and
        <TT
CLASS="FILENAME"
>*.redhat.com</TT
> machines.  It also allows talk,
        finger, and FTP requests from all machines.
      </P
><P
>        <B
CLASS="COMMAND"
>tcpd</B
> allows much more sophisticated access control,
        using a combination of <TT
CLASS="FILENAME"
>/etc/hosts.allow</TT
> and
        <TT
CLASS="FILENAME"
>/etc/hosts.deny</TT
>.  Read the tcpd(8) and
        hosts_access(5) man pages for complete details.
      </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="s1-sysadmin-sendmail.htm"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.htm"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="s1-sysadmin-ftp.htm"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Sendmail</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ch-sysadmin.htm"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Anonymous FTP</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>