博客
关于我
亚马逊AWS实例设置为账号密码登陆
阅读量:464 次
发布时间:2019-03-06

本文共 580 字,大约阅读时间需要 1 分钟。

转:

亚马逊AWS实例的登陆方式都是密钥登陆,我个人觉得很不方便,不太习惯,于是记录一下修改为账号密码登陆的过程。

1.连接登陆到实例

用密钥登陆到centos,下面是xshell的登陆设置

登陆的时候选择用户记得选centos,root用户是登陆不上的。

WARNING! The remote SSH server rejected X11 forwarding request.Please login as the user "centos" rather than the user "root".

2.设置用户名密码登陆

1.先给root用户设置密码

sudo passwd root

2.切换到root用户

su root

3.输入以下命令启用用户名密码登陆

sed -ri 's/^#?(PasswordAuthentication)s+(yes|no)/1 yes/' /etc/ssh/sshd_configsed -ri 's/^#?(PermitRootLogin)s+(yes|no)/1 yes/' /etc/ssh/sshd_configsed -ri 's/^/#/;s/sleep 10"s+/&n/' /root/.ssh/authorized_keys

4.重启sshd生效

service sshd restart

转:

转载地址:http://ozkbz.baihongyu.com/

你可能感兴趣的文章
ng 指令的自定义、使用
查看>>
ng6.1 新特性:滚回到之前的位置
查看>>
nghttp3使用指南
查看>>
Nginx
查看>>
nginx + etcd 动态负载均衡实践(一)—— 组件介绍
查看>>
nginx + etcd 动态负载均衡实践(三)—— 基于nginx-upsync-module实现
查看>>
nginx + etcd 动态负载均衡实践(二)—— 组件安装
查看>>
nginx + etcd 动态负载均衡实践(四)—— 基于confd实现
查看>>
Nginx + Spring Boot 实现负载均衡
查看>>
Nginx + Tomcat + SpringBoot 部署项目
查看>>
Nginx + uWSGI + Flask + Vhost
查看>>
Nginx - Header详解
查看>>
nginx - thinkphp 如何实现url的rewrite
查看>>
Nginx - 反向代理、负载均衡、动静分离、底层原理(案例实战分析)
查看>>
Nginx - 反向代理与负载均衡
查看>>
nginx 1.24.0 安装nginx最新稳定版
查看>>
nginx 301 永久重定向
查看>>
nginx 301跳转
查看>>
nginx 403 forbidden
查看>>
nginx connect 模块安装以及配置
查看>>