使用XSHELL连接EC2虚拟机实例

1
2
3
4
5
6
7
8
sudo passwd root #输入2次密码给root用户设定密码
su -
passwd ec2-user #输入两次密码给ec2-user用户设定密码
sed -ri 's/^#?(PasswordAuthentication)\s+(yes|no)/\1 yes/' /etc/ssh/sshd_config
sed -ri 's/^#?(PermitRootLogin)\s+(yes|no)/\1 yes/' /etc/ssh/sshd_config #修改配置文件
sed -ri 's/^/#/;s/sleep 10"\s+/&\n/' /root/.ssh/authorized_keys
重启实例
使用ubuntu或者其他非root用户连接
posted @   BIGBIGBIG  阅读(1243)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示