AWS EC2 Linux | ssh 使用密码登录
1、使用AWS控制台创建的密钥对或者直接通过网页登录
注意:使用pem私钥不允许直接登录root用户,只能登录默认用户例如:ec2-user ,ubuntu等等
2、创建root密码
sudo passwd root
3、切换到root用户
su root
4、修改 sshd_config 文件
vim /etc/ssh/sshd_config
-
允许使用密码登录
PasswordAuthentication yes -
允许root用户登录
PermitRootLogin yes
注意:如果 PermitRootLogin 项找不到自行添加
5、重新启动ssh服务
systemctl restart sshd
至此大功告成,可以使用ssh直接通过密码登录
参考:
http://www.unclealan.cn/index.php/system/176.html
https://nachifur.blog.youkuaiyun.com/article/details/105399039
本文介绍如何在 AWS EC2 实例上配置 SSH 服务,使其支持密码登录及 root 用户登录。通过修改 sshd_config 文件并重启 ssh 服务实现。适用于需要简化远程登录流程的场景。
52

被折叠的 条评论
为什么被折叠?



