linux – 通过在iptables(Ubuntu)中添加规则来打开端口443

linux – 通过在iptables(Ubuntu)中添加规则来打开端口443,第1张

概述我是ubuntu新手并使用ubuntu服务器12.04. 当我运行nmap localhost时,我得到以下输出: Not shown: 997 closed portsPORT STATE SERVICE22/tcp open ssh80/tcp open http3306/tcp open mysql 这意味着端口443(https)已关闭.我想打开它. 所以我做 我是ubuntu新手并使用ubuntu服务器12.04.
当我运行nmap localhost时,我得到以下输出:

Not shown: 997 closed portsPORT     STATE SERVICE22/tcp   open  ssh80/tcp   open  http3306/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.rulespost-down iptables-save > /etc/iptables.rules

重新启动我的系统后,我运行了sudo iptables -L和线路

Chain input (policy ACCEPT)target     prot opt source               destinationACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https

是可见的.

但是现在当我运行nmap localhost时,我仍然没有看到443是开放的.

请帮忙!

解决方法 我打赌你没有在主机上听443端口.试试这个:在一个终端运行sudo nc -lk 443,然后运行你的nmap localhost.这可能与iptables防火墙规则无关. 总结

以上是内存溢出为你收集整理的linux – 通过在iptables(Ubuntu)中添加规则来打开端口443全部内容,希望文章能够帮你解决linux – 通过在iptables(Ubuntu)中添加规则来打开端口443所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/1028173.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存