Oracle Cloud Free Server

in server •  3 years ago 

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.开启并修改你的root密码:
sudo -i
echo root:你的新密码 |sudo chpasswd root
sed -i 's/^#?PermitRootLogin./PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/^#?PasswordAuthentication./PasswordAuthentication yes/g' /etc/ssh/sshd_config;
service sshd restart

3.卸载相关程序
pcbind
使用netstat -ntlp命令发现rpcbind监听了111端口,如担心安全可执行以下命令卸载禁用:
systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl disable rpcbind
systemctl disable rpcbind.socket

oracle-cloud-agent卸载甲骨文云官方后台监控程序
systemctl stop oracle-cloud-agent
systemctl disable oracle-cloud-agent
systemctl stop oracle-cloud-agent-updater
systemctl disable oracle-cloud-agent-updater

4.防火墙相关

开放所有端口
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
清除防火墙规则
rm -rf /etc/iptables/rules.v4
rm -rf /etc/iptables/rules.v6

甲骨文服务器(Oracle Cloud)开启root用户登录
*到启动脚本,我们将配置好的脚本粘贴进去,在机器创建时会配置root登陆

#!/bin/bash
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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!