linux学习 tcp回绕
tcpwrap--tcp回绕
1.数据包的传递需经过:firewalld、server本身、selnux、文件权限的限制
其中firewalld与server本身的限制之间也会有xinetd--守护进程、tcp回绕
2.tcp回绕:需要有加载模块(即加载插件),才能有该功能。
which 服务名
[[email protected] ~]# systemctl start vsftpd
[[email protected] ~]# which vsftpd
/usr/sbin/vsftpd
[[email protected] ~]# ldd /usr/sbin/vsftpd
linux-vdso.so.1=> (0x00007fffe6b89000)
libssl.so.10=> /lib64/libssl.so.10 (0x00007fc3c99cb000)
libwrap.so.0=> /lib64/libwrap.so.0 (0x00007fc3c97c0000) ##表明支持tcp回绕
............
3./etc/hosts.deny ##黑名单
/etc/hosts.allow ##白名单,比黑名单优先级高
4.例:
(1)服务端--172.25.254.116
yum install vsftpd -y
vim /etc/hosts.deny
ALL:ALL ##拒绝所有主机访问所有服务,如sshd服务
:wq
vim /etc/hosts.allow
sshd:ALL ##允许访问sshd服务,因为白名单比黑名单优先级高,所以会起作用
:wq
5.可以实现监控日志
vim /etc/hosts.allow
sshd:ALL:spawn echo `date` from %c to %s | mail -s warning root
##当另一端主机访问该服务时,则以邮件格式提醒root用户,也可以设置为其他用户
##也可以是生成日志格式
:wq