谷歌云VPS开启SSH登录及修改ROOT密码

1.先选择从浏览器打开ssh连接服务器

2.切换到root账号

sudo -i   // 切换到root账号
passwd   // 修改root账号密码

3、CentOS和Debian通用,输入以下两条命令

sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
service sshd restart   ##重启ssh

4、Ubuntu系统,输入以下两条命令

sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
reboot

 

本文章由 brokenway 发布在 个人知识库 ,文章所述不代表本站观点,法律风险由发布者自行承担,转载请注明出处!
(0)
brokenway的头像brokenway
上一篇 2020年6月25日
下一篇 2020年8月4日

相关文章