Oracle 云排雷记录

友情提醒:经过一下午的折腾,Oracle 云请不要安装 CentOS 8 ,因为系统内的 Firewalld 有问题,就算规则都正常也无法访问 22 端口以外的其他端口😊


解决 CentOS 8 下每次执行 yum 都会出现Failed loading plugin "osmsplugin": No module named 'librepo'的错误提示,解决办法:

dnf -y install python3-librepo

Cloud-init 脚本设置 SSH Root 登陆:

其原理就是新实例开机的时候自动执行该脚本修改 sshd_config 这个配置文件,从而实现 SSH 可用 root 账号及密码来登陆,其中 Password 是我们需要修改的 root 密码,PermitRootLogin 和 PasswordAuthentication 是使用密码登录的关键,并且必须是设置为 yes 才能正常 ssh 密码登录。

通用型

#!/bin/bash
echo root:Password | 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

DD 装 Debian 11:

https://github.com/bohanyang/debi

参考命令

curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && chmod a+rx debi.sh
./debi.sh --ethx --ssh-port SSH端口 --user root --password ROOT密码
shutdown -r now

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注