tcp_wrap之实例

实例:
    1.允许172.16.0.0网段访问sshd
        #vim /etc/hosts.allow
            sshd: 1271.16.

        #vim /etc/hosts.deny
            sshd: ALL

    2.不允许172.16.0.0网段访问,允许172.16.100.200访问telnet,其他客户端不受控制
        #vim /etc/hosts.allow
            in.telnetd: 172.16.100.200

        #vim /etc/hosts.deny
            in.telnet: 172.16.

        或
        #vim /etc/hosts.deny
            in.telnet: 172.16. EXCEPT 172.16.100.200

        或
        #vim /etc/hosts.allow
            in.telent: ALL EXCEPT 172.16. EXCEPT 172.16.100.200

        #vim /etc/hosts.deny
            in.telnet: ALL

    3. 不允许172.16.0.0网段访问访问telnet,其他客户端不受控制
         #vim /etc/hosts.allow
            in.telnetd: 172.16. : DENY

        #vim /etc/hosts.deny
            in.telnet:  ALL

    4.允许172.16.0.0网段访问telnet,其他客户端禁止,并记录日志
         #vim /etc/hosts.allow
            in.telnetd: 172.16.  : spwan echo “Someone Entered!! `data`”  >> /var/log/tenlentlogin.log

        #vim /etc/hosts.deny
            in.telnet:  ALL

    5.进一步详细日志
         #vim /etc/hosts.allow
            in.telnetd: 172.16.  :spwan echo “`data`,Login attempt from %c to %s ,”  >> /var/log/tenlentlogin.log

        #vim /etc/hosts.deny
            in.telnet:  ALL   :spwan echo “`data`,Login attempt from %h,”  >> /var/log/tenlentlogin.log

你可能感兴趣的:(linux,wrap)