首先,修改一下pem文件的权限,因为只需要读,所以执行
chmod 400 xxx.pem
ssh -i xxx.pem ec2-user@YOUR_IP
登陆之后修改ROOT的密码
sudo passwd root
修改sshd_config文件,开启「允许密码登陆」和「允许ROOT密码登陆」。
# 修改/etc/ssh/sshd_config中的以下参数
PermitRootLogin yes
PasswordAuthentication yes
UsePAM yes
重启服务器,以便让配置生效。
sudo reboot
大概等一分钟之后再登陆。
![](https://img.haomeiwen.com/i645691/7e0e1f892991560a.jpg)
网友评论