甲骨文创建,允许ssh密码登录的cloud-init脚本

转自hostloc备用

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

将第二行的password123789换成自己的明文密码,ubuntu debian理论上全版本都支持

上一篇
下一篇