进入ROOT模式:sudo -i
1:Oracle Cloud 开启root登录
SSH里面粘贴如下脚本,其中的******为你自己需要设置的root密码 echo root:****** |sudo chpasswd root sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config sudo service sshd restart
2:安装相关依赖
centos系统下
yum update -y
ubuntu系统下
apt update -y
apt-get update -y && apt-get install curl -y
3:删除、关闭、打开各自系统的无用附件、防火墙、端口及规则
3.1 Centos系统下:删除多余附件
systemctl stop oracle-cloud-agent
systemctl disable oracle-cloud-agent
systemctl stop oracle-cloud-agent-updater
systemctl disable oracle-cloud-agent-updater
停止firewall systemctl stop firewalld.service 禁止firewall开机启动 systemctl disable firewalld.service
3.2 Ubuntu系统下:开放所有端口
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
Ubuntu镜像默认设置了Iptable规则,关闭它
apt-get purge netfilter-persistent
reboot
或者强制删除
rm -rf /etc/iptables && reboot














