谷歌云VPS和AWS云主机使用root用户和密码登陆的快速设置方法

5.48K 浏览技术资料
0

谷歌云VPS和AWS云主机默认的都无法使用Root账号登录,这里我们有一个快速设置谷歌云VPS和AWS云主机使用Root账号登录的方法。我们只需要在部署VPS时设置以下启动脚本即可(把其中的123456改成自己的root密码):

#!/bin/bash
echo root:123456 |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 service sshd restart

谷歌云VPS主机设置如下:(点击放大)

亚马逊AWS主机设置如下:(点击放大)

参考:https://www.tryboy.org/archives/1454/


分享到:
Qi 编辑问题 2019年10月21日
添加评论
写下您的答案。

Login

Welcome! Login in to your account

Remember me Lost your password?

Don't have account. Register

Lost Password

Register