top

AWS Lightsail 开启 Root 密码登陆权限

是一个脚本,开始创建用例的时候设为用户脚本,也可以在实例中执行该脚本。

将下面代码中的第一句中的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
THE END
icon
1
icon
打赏
icon
分享
icon
二维码
icon
海报
share
share
share
qrcode

如果本内容对您有帮助,欢迎给我打赏,支持创作

正在生成,请稍后
发表评论
添加表情
发表评论
评论列表