不积跬步,无以至千里!
	下载密钥对文件xxx.pem,命令行窗口切换到密钥对存放的目录,
用密钥登录服务器
ssh -i "xxx.pem" ec2-user@IP
	
#登录成功后切换到root账号
	sudo passwd root
#设置root密码
su  root
#修改配置,允许root登录服务器
vi /etc/ssh/sshd_config
 (取消以下部分前的#,获取改yes /no)
Port 22
AddressFamily any
ListenAddress 0.0.0.0
ListenAddress :: 
 
PermitRootLogin yes
 
PasswordAuthentication yes
 
GSSAPIAuthentication no
 
然后重启服务
 
systemctl restart sshd