<分区>
我是 ubuntu 的新手,使用的是 ubuntu 服务器 12.04。
当我运行 nmap localhost
时,我得到以下输出:
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3306/tcp open mysql
这意味着端口 443(https) 已关闭。我想打开它。 所以我做了以下事情:
我运行了命令
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
为了保留更改,我使用 sudo sh -c "iptables-save >/etc/iptables.rules"
然后我将以下行添加到 etc/network/interfaces
:
pre-up iptables-restore < /etc/iptables.rules
post-down iptables-save > /etc/iptables.rules
重新启动系统后,我运行了 sudo iptables -L
和行
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:https
可见。
但是现在当我运行 nmap localhost
时,我仍然看不到 443 是打开的。
请帮忙!