-
首次实例化机器后,先以ec2-user登录服务器
-
改root密码
sudo passwd root
-
然后以root角色登录,修改配置:
cd /etc/ssh
vim /sshd_config
-
找到PermitRootLogin,改为下方这种,PasswordAuthentication可能没有,需要新增,
查找参数命令: /PermitRootLogin
PermitRootLogin yes PasswordAuthentication yes

-
重启sshd
/sbin/service sshd restart
6.然后就可以密码登录了