之前用nmap扫描的是,发现有的状态是closed,不解啥意思,今天做iptables测试的时候发现了
nmap x.x.x.x(公网ip)
返回的结果是22端口,closed,ssh服务,80端口,open,http服务
查看源机器的iptables规则
默认的INPUT,FORWARD,OUTPUT是DROP,所以只能添加放行
测试的时候,规则是这么添加的:
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
iptables -A OUTPUT -p tcp --sport ssh -j ACCEPT
删除了这两条规则之后
再次nmap扫描查看,消失了