Oracle Cloud实例Ubuntu防火墙设置

Oracle Cloud实例开通,并在公共子网中添加安全列表,开通的80等端口后,安装Nginx服务器,依然无法访问,因为操作系统ubuntu的防火墙还未设置,默认情况下,同样是只有ssh端口开放的。

与国内的阿里云还有腾讯云,使用ufw管理系统防火墙不同,Oracle Cloud的Ubuntu操作系统使用的是iptables管理。

相比较ufw,iptables就繁琐多了,开放所有端口

sudo su

# iptables -P INPUT ACCEPT

# iptables -P FORWARD ACCEPT

# iptables -P OUTPUT ACCEPT

# iptables -F

这样再访问云服务器,此前安装的Nginx就可以访问了。

后来索性直接强制删除,以后直接通过ufw管理:

# rm -rf /etc/iptables

# reboot

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>