Oracle 云主机默认镜像ubuntu 18.04的坑

开了一台甲骨文的San Jose 数据中心的Cloud VM,默认支持的系统中没有debian,因此退而求其次选择了ubuntu 18.04 minimum.

按照习惯,把SSH端口从22改成了一个其他的端口,但是确发现SSH始终都连不上了.  检查了这个VM的security list,所有的端口都打开了,没有问题,看来问题只能出在ubuntu的默认防火墙上了.

默认的ubuntu 18.04的防火墙是iptables, 默认没有安装ufw,而且oracle 官方也不推荐使用ufw(这是后来才知道的)

可是按照ubuntu/debian的默认安装,防火墙iptables虽然是默认开启的,但是里面没有任何的规则. google了半天才发现原来是Oracle给他的默认的linux 的OS 都写入了默认的规则,路径在/etc/iptables/rules.v4 和rules.v6.

把rules.v4的规则里的两条reject 规则给他comment out,就可以了.

#-A INPUT -j REJECT --reject-with icmp-host-prohibited
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited

 

Leave a Reply

Your email address will not be published. Required fields are marked *

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>

This site uses Akismet to reduce spam. Learn how your comment data is processed.