AWS EC2 Linux | ssh 使用密码登录

1、使用AWS控制台创建的密钥对或者直接通过网页登录

注意:使用pem私钥不允许直接登录root用户,只能登录默认用户例如:ec2-user ,ubuntu等等

2、创建root密码

Bash
sudo passwd root

3、切换到root用户

Bash
su root

4、修改 sshd_config 文件

Bash
vi /etc/ssh/sshd_config

允许使用密码登录

Bash
PasswordAuthentication yes

允许root用户登录

Bash
PermitRootLogin yes

注意:如果 PermitRootLogin 项找不到自行添加

5、重新启动ssh服务

Bash
systemctl restart sshd



版权声明:
本文出处:HiFeng'Blog

访问原文:https://www.hicairo.com/

版权归属原作者,如有问题,欢迎留言联系删除。

网友留言(0 条)

发表评论

验证码