AWS Lightsail 开启 Root 登陆权限

原文链接:http://chenxuhua.com/blog/aws-lightsail-enable-root-login/


将下面代码中的第一句中的 Passwd 改为自己将要设置的密码,否则默认 root 密码为 Passwd

#!/bin/bash
echo root:Passwd |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
posted @ 2020-03-31 14:16  陈旭华  阅读(5511)  评论(0编辑  收藏  举报