URL
type
status
date
slug
summary
tags
category
icon
password
亚马逊AWS-EC2主机安装ubuntu系统后,默认的远程登录方式并不是我们常用的账号密码方式,对于需要远程操作的用户并不是太方便。通过下面的设置方法我们可以将默认的登录方式变为常用的账号密码登录方式。
📝 AWS-EC2改为账号密码登录
AWS-EC2改为账号密码登录
📝 AWS-EC2改为账号密码登录1、链接实例2、切换为Root权限3、修改SSH配置文件:3.1、打开配置文件:3.2、开启PermitRootLogin项3.3、删除PermitRootLogin后面的单词3.4、在PermitRootLogin后面输入yes3.5、搜查找PasswordAuthentication3.6、PasswordAuthentication后面的no改为yes3.7、存盘退出4、设置root用户密码4.1、输入:passwd回车4.2、输入密码5、重启ssh服务
1、链接实例

2、切换为Root权限

3、修改SSH配置文件:
3.1、打开配置文件:
3.2、开启PermitRootLogin项
移动光标到:#PermitRootLogin prohibit-password,按x删除#号

3.3、删除PermitRootLogin后面的单词
按w移动到下一个单词,按dw将后面单词删除

3.4、在PermitRootLogin后面输入yes
按a进入编辑模式,输入yes,再按esc键推出编辑模式

3.5、搜查找PasswordAuthentication
按/ 然后输入PasswordAuthentication 后回车(搜索PasswordAuthentication)

3.6、PasswordAuthentication后面的no改为yes
按w移动到后面的单词弄no,按dw删除单词no,按a进入编辑模式,输入yes,在按esc退出编辑模式。

3.7、存盘退出
按冒号(:)后,再按wq存盘退出
4、设置root用户密码
4.1、输入:passwd回车
4.2、输入密码
输入过程中看不到输入的密码,总共输入两次密码,一次是密码,一次是验证密码
5、重启ssh服务
输入 systemctl restart ssh
重启后,客户端中就可以设置使用root用户及密码登录了
- 作者:小布
- 链接:https://www.smallstep.one/article/content-11
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章