トップ/ Linuxのお部屋

Index/ previous/ next


inetdの設定(tcp-wrapper)

  1. [/etc/inetd.conf]の設定
  2. telnet,ftp,pop3は、inetdのサービスなので、inetd.confで有効にします。
    Turbo Linux Serverでは、デフォルトだとどれも起動しないです。

    diff -u inetd.conf.org inetd.conf
    --- inetd.conf.org     Wed Apr 14 11:35:10 1999
    +++ inetd.conf     Thu Apr 15 11:52:26 1999
    @@ -30,8 +30,8 @@
     #
     # These are standard services.
     #
    -#ftp   stream  tcp     nowait  root    /usr/sbin/tcpd  in.ftpd -l -a
    -#telnet        stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd
    +ftp    stream  tcp     nowait  root    /usr/sbin/tcpd  in.ftpd -l -a
    +telnet stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd
     #gopher        stream  tcp     nowait  root    /usr/sbin/tcpd  gn
    
     # do not uncomment smtp unless you *really* know what you are doing.
    @@ -52,7 +52,7 @@
     # Pop and imap mail services et al
     #
     #pop-2   stream  tcp     nowait  root    /usr/sbin/tcpd        ipop2d
    -#pop-3   stream  tcp     nowait  root    /usr/sbin/tcpd        ipop3d
    +pop-3   stream  tcp     nowait  root    /usr/sbin/tcpd ipop3d
     #imap    stream  tcp     nowait  root    /usr/sbin/tcpd        imapd
     #
     # The Internet UUCP service.
    

  3. [/etc/hosts.allow]の変更
  4. ローカルネットワークからinetdのサービスが使えるように、tcp-wrapperの設定を変更します。
    pop-3のサービスは、外部からも参照できるようにするため、個別に設定します。

    --- /root/master/hosts.allow    Wed Apr 14 11:51:10 1999
    +++ /etc/hosts.allow    Thu Apr 15 18:23:41 1999
    @@ -7,6 +7,8 @@
     # Suppose your network in Xs.
    
     ALL : 127.0.0.1 : allow
    +ALL :  192.168.0. :    allow
    +ipop3d :       ALL :   allow
    
     # To allow local network access to inetd.
     # ALL : XXX.XXX.XXX.0/255.255.255.0 : allow
    

    サービス名 : ホスト名 or ネットワーク名 : 許可("allow" or "deny")
    上記のようなフォーマットで記述します。

    ここでは、
    inetdのすべてのサービスをネットワーク"192.168.0."に対して有効する。
    pop3のサービスをすべてのネットワークに対して有効にする。
    ということになります。

  5. inetdの再起動
  6. 設定を変更したのでinetdを再起動します。

    
    # ps aux|grep inetd
    root       167  0.0  0.3   792   404  ?  S    18:50   0:00 inetd
    
    #kill -HUP 167