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