关于linux:AWS-Lightsail-开启-Root-登陆权限

6次阅读

共计 267 个字符,预计需要花费 1 分钟才能阅读完成。

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