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

1.方法一

亚马逊云默认用户名ec2-user|root|centos

1、修改ROOT密码
sudo passwd root
用完再把权限改回来
----------------ubuntu 修改-----------------------
3、vi /etc/ssh/sshd_config
修改
PermitRootLogin yes
PasswordAuthentication no

————-centos修改—————
PermitRootLogin yes
PasswordAuthentication yes
UsePAM no
—————————-
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 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容