亚马逊(AWS)的Lightsail VPS设置使用账号密码登录方法,以CentOS7为例

《亚马逊(AWS)的Lightsail VPS设置使用账号密码登录方法,以CentOS7为例》

 

1:设置root密码
[centos@ip-172-26-7-205 ~]$ sudo passwd root
2:切换到root模式
[centos@ip-172-26-7-205 ~]$ su root
3:设置登录方式为 root+密码
[centos@ip-172-26-7-205 ~]$ sed -ri 's/^#?(PasswordAuthentication)\s+(yes|no)/\1 yes/' /etc/ssh/sshd_config
[centos@ip-172-26-7-205 ~]$ sed -ri 's/^#?(PermitRootLogin)\s+(yes|no)/\1 yes/' /etc/ssh/sshd_config
[centos@ip-172-26-7-205 ~]$ sed -ri 's/^/#/;s/sleep 10"\s+/&\n/' /root/.ssh/authorized_keys
4:重启sshd服务
[centos@ip-172-26-7-205 ~]$ service sshd restart

 

 

 

https://www.jianshu.com/p/0f995b17b679



发表评论

您的电子邮箱地址不会被公开。

8 + 2 =