在我们的实际使用中,我们经常需要将VPS的所有端口放开。但是Oracle Cloud为了安全考虑,默认只开启了22端口,下面就和大家一起打开VPS的所有端口。
- 登录控制面板
- 在控制台更改为中文
- 进入菜单,依次点击“网络”→“虚拟云网络”
- 进入默认创建好的云网络块
- 点击“安全列表”,点击默认的安全组
- 依次点击“入站规则”→“添加入站规则”
- 如图设置
- 将其自带的规则删除
- 如为Oracle Cloud的CentOS或Ubuntu自带系统,运行以下命令放开端口
CentOS:
systemctl stop oracle-cloud-agent systemctl disable oracle-cloud-agent systemctl stop oracle-cloud-agent-updater systemctl disable oracle-cloud-agent-updater systemctl stop firewalld.service systemctl disable firewalld.service
Ubuntu:
iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -F apt-get purge netfilter-persistent -y