#!/bin/bash a=`/sbin/iptables -nvL --line-number |awk '/dpt:22/{if($4=="DROP" -o $4=="REJECT")print}'|wc -l` if [ "$a" -lt 2 ] then echo "$a" >> /tmp/iptable22.log /sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT #/etc/init.d/iptables restart fi
检测sshd端口误封脚本
原创wsw26 博主文章分类:shell脚本练习和实战 ©著作权
©著作权归作者所有:来自51CTO博客作者wsw26的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
linux服务器安全监测脚本
Linux服务器安全监测
linux 管理员 ip地址 服务器安全