甲骨文云,创建实例时绕开万年不对的SSH密钥对

创建新的免费实例,选择Ubuntu镜像,SSH密钥对在登录时一直不正确,删除重建了N次,干脆绕开这个奇怪的设计。按下图在最后的高级选项里添加如下的初始化脚本,然后用密码登录即可。

1
2
3
4
5
#!/bin/bash
echo root:123456789 sudo chpasswd root
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo service sshd restart

甲骨文云,创建实例时绕开万年不对的SSH密钥对
https://b.limour.top/2115.html
Author
Limour
Posted on
January 29, 2023
Licensed under