亚马逊云ubuntu root登录 关闭密钥登录

1.方法一

1、修改ROOT密码
sudo passwd root
2、sudo chmod 777 /etc/ssh/sshd_config
用完再把权限改回来

3、vi /etc/ssh/sshd_config
修改
PermitRootLogin yes
PasswordAuthentication no

————-centos修改—————
UsePAM yes
PermitRootLogin yes
PasswordAuthentication yes
—————————-
4重启ssh、
sudo systemctl restart sshd

2方法二

创建root 用户修改密码或者使用默认账户修改密码

sudo sed -i 's/^PasswordAuthentication no$/PasswordAuthentication yes/' /etc/ssh/sshd_config.d/60-cloudimg-settings.conf

然后重启sshd:sudo systemctl restart ssh

问题解决
© 版权声明
THE END
喜欢就支持一下吧
点赞9 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容