我正在尝试在我的 VPS 上打开一个端口(2012),以便我可以通过互联网访问它。
这是输出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
显示这个:
sudo netstat -anp | grep :2012
tcp 0 0 127.0.0.1:2012 0.0.0.0:* LISTEN 15303/X-engine
答案1
监听端口 2012 的服务仅监听本地主机 (127.0.0.1)。
这是不可路由的。
使其监听服务器的 IPV4(或 IPV6)。
答案2
默认情况下,nmap 仅探测最常用的 1000 个端口。如果要扫描特定端口,请按如下方式使用 nmap:
nmap ... -p2012 ...