AWS Lightsail,EC2, GCP, AZURE,开启root登陆权限

启动脚本设置为

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

标签: none