A detailed description of TCP wrapper usage under Linux

Source: Internet
Author: User

Wrapper is a tool for access control, much like the iptables functionality, but much smaller than iptables functionality, and is typically used only when the following conditions are met to use TCP wrapper



Check if the software tool you want to control supports TCP_WRAP:LDD/USR/SBIN/SSHD (if there is a wrap libraryrepresentative support)/LDD ' which xinted ' | grep libwrap


Wrapper access control statements are written in the following two files:/etc/hosts.allows and/etc/hosts.deny


Let me give some example 1:

/etc/hosts.allow---in.telnetd:192.168. EXCEPT 192.168.77.100 (Allow 192.168. Network Segment host Access EXCEPT remove 192.168.77.100 not accessible)

/etc/hosts.deny---in.telnetd:ALL (all rejections except allow)--(Why do you want to add the rejection anyway, because the 192.168.77.100 removed in the Allow file is not matched by the Allow file control, Can only be matched by a deny file)

Let me give some example 1:

/etc/hosts.allow---in.telnetd:192.168. : Spawn echo "You ren Fang Wen ' date '" >>/var/log/tcpwrap.log (so you can log in when you can access it) + do not log IP and access services

/etc/hosts.allow---in.telnetd:192.168. : Spawn echo "' Date ', soment login from%c to%s." >>/var/log/tcpwrap.log (this is the recording of clients and access to server IP and services)

/etc/hosts.allow---in.telnetd:192.168. EXCEPT 192.168.77.100:spawn echo "' Date ', soment login from%c to%s." >>/var/log/tcpwrap.log

/etc/hosts.deny---in.telnetd:ALL:spawn echo "' Date ', soment some from%h." >>/var/log/tcpwrap.log (these two lines are record error records, But must allow a denied access)

General tcp_wrap commonly used macros (can direct man 5 hosts_access refer to more macros):

%c:client information ([email protected])

%s:service info ([email protected])

%h:client hostname

%p:server PID


This article is from the "experience-based staff" blog, please be sure to keep this source http://zhangjianxin.blog.51cto.com/10134758/1652786

A detailed description of TCP wrapper usage under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.