我试图打开一个端口(2012)在我的VPS,所以我可以通过互联网访问它。
这是sudo iptables -L产生的输出
Chain INPUT (policy ACCEPT) target prot opt source destination fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh ACCEPT all -- anywhere anywhere REJECT all -- anywhere loopback/8 reject-with icmp-port- ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http ACCEPT tcp -- anywhere anywhere tcp dpt:https ACCEPT tcp -- anywhere anywhere tcp dpt:2012 ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh ACCEPT icmp -- anywhere anywhere LOG all -- anywhere anywhere limit: avg 5/min burst 5 LOG level debug prefix "iptables denied: " DROP all -- anywhere anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination DROP all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere Chain fail2ban-ssh (1 references) target prot opt source destination RETURN all -- anywhere anywhere
Nmap发现端口25,22和80.请问我可能做错了什么?
编辑:
netstat -anp | grep :2012 netstat -anp | grep :2012显示:
sudo netstat -anp | grep :2012 tcp 0 0 127.0.0.1:2012 0.0.0.0:* LISTEN 15303/X-engine
在端口2012上监听的服务仅在本地主机(127.0.0.1)上进行监听。
这是不可路由的。
让它监听服务器的IPV4(或IPV6)。
默认情况下,nmap只探测最常用的1000个端口。 如果你想扫描一个特定的端口,像这样使用nmap:
nmap ... -p2012 ...