#!/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賬號密碼即可.這樣創(chuàng)建完實例后即可使用root賬號登陸小🐔了