#!/bin/bash
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
提示:密码替换为你自己想要设置的root账号密码即可.这样创建完实例后即可使用root账号登陆小🐔了