aws 服务器 ssh 密码远程连接

347 阅读1分钟

背景

通过信用卡薅了一年 aws 服务器的羊毛,1 cpu 30g固态硬盘,默认服务器不允许 root 用户使用密码进行 ssh 连接,因此需要以下的步骤通过密码远程 ssh 连接到服务器。

步骤

使用 AWS 控制台进行网页登录

image-20231209123102231

创建 root 密码

sudo passwd root

切换到 root 用户

su root

修改 sshd_config 文件

vim /ect/ssh/sshd_config

允许使用密码登录

PasswordAuthentication yes

允许 root 用户登陆

PermitRootLogin yes

重新启动 ssh 服务

systemctl restart sshd