Aws Lightsail root登录启动脚本

创建实例时,如图点击:Add launch script

输入脚本代码:

echo root:urpassword |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

其中 “urpassword” 是你的密码,也可以创建实例登录后用 passwd 命令设置。

赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权,转载请注明出处。
文章名称:《Aws Lightsail root登录启动脚本》
文章来自:泰恩数据
文章链接:https://tyne.cc/1246.html
本站资源仅供个人学习使用,请勿用于商业用途。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址