ALearner

  • 首页
  • Python
  • Linux
  • Java
  • 工具
  • 前端
  • 算法
  • My World
HelloStranger
每个人都是初学者
  1. 首页
  2. Linux
  3. 正文

将亚马逊aws的ec2服务器的登陆方式改为密码登陆

2017年7月22日 7928点热度 0人点赞 0条评论

1.在用密钥登陆ec2后,为root用户创建密码:

sudo passwd root

系统会让你输入两次密码

2.切换为root用户,并且编辑sshd_config文件,PasswordAuthentication no,把no改成yes。使系统允许密码登陆

su root

vim /etc/ssh/sshd_config

3.重启ssh服务

/etc/init.d/ssh restart

ssh位置因系统而异

4.为原来的用户添加密码,我原来的用户是ubuntu

passwd ubuntu

提示输入两次密码

 

5.此时还是不能用root登录,只能用ubuntu登陆,如果需要使用root用户登陆需要修改sshd_config文件,参考:http://bbs.qcloud.com/thread-11554-1-1.html

vim /etc/ssh/sshd_config

找到  PermitRootLogin 这项 将其改为 yes

6.再次重启ssh服务。参考了以上链接可以使用下面的方式重启ssh

service ssh  restart

本文转载:叉烧店 » 将亚马逊aws的ec2服务器的登陆方式改为密码登陆

相关

本作品采用 知识共享署名 4.0 国际许可协议 进行许可
标签: SSH
最后更新:2017年7月22日

iquantumer

你现在的态度决定你十年后是人物还是废物。

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2022 alearner.top. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

鲁ICP备16024047号