oracle甲骨文云建立新实例后必要操作(网络搜集)
oracle甲骨文后台界面 设置:入站规则,IP协议为所有协议,源 CIDR为0.0.0.0/0
开放指定端口
iptables -I INPUT 1 -p tcp --dport 端口 -j ACCEPT iptables-save 重启后需重新打开!
一、oracle甲骨文云必要操作:
进入ROOT模式:
sudo -i
1:安装相关依赖 centos系统下
yum -y install wget yum update -y && yum install curl -y
ubuntu系统下
apt-get install wget apt-get update -y && apt-get install curl -y
2:删除、关闭、打开各自系统的无用附件、防火墙、端口及规则 注意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
注意Ubuntu系统下: 开放所有端口
iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -F
Ubuntu镜像默认设置了Iptable规则,强制删除
rm -rf /etc/iptables && reboot
同步时间:
rm -rf /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
更改为root用户密码登陆
首先登录后切换为root,如下命令修改root密码
新方法:一键脚本
wget -O oraclessh.sh https://raw.githubusercontent.com/BlueSkyXN/ChangeSource/master/oraclessh.sh && chmod +x oraclessh.sh && ./oraclessh.sh
脚本默认密码为password12345678
可以用passwd命令自行修改
centos需改为6位数以上,ubuntu随便
(旧)passwd 修改新密码
再依次执行如下代码:
sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config sed -i "s/PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
重启sshd服务
systemctl restart sshd reboot