侧边栏壁纸
博主头像
微尘 博主等级

行动起来,活在当下

  • 累计撰写 132 篇文章
  • 累计创建 1 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

AWS Lightsail 开启 Root 密码登陆权限

Administrator
2024-02-03 / 0 评论 / 0 点赞 / 31 阅读 / 0 字

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

将下面代码中的第一句中的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
0

评论区