开启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
修改脚本中的 密码 为你想要设置的

机器创建之后,首次连接会有一次断开
这预示着可以愉快的玩耍了
文章出处:https://xidcn.com/127.html