码迷,mamicode.com
首页 > 系统相关 > 详细

linux下ssh无法连接的原因

时间:2017-02-13 20:25:05      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:安装   class   word   blog   pen   无法   创建   rest   password   

在虚拟机上安装了ubuntu16.04 server,用本机 ssh 连接的时候 无法连接上;

忽然想起在安装的时候有个openssh好像没有勾选,所以在虚拟机上

apt install openssh-server;

现在可以连接上了,但是在输入root密码的时候验证不通过,在安装的时候我创建了一个普通用户,ssh 用普通用户可以连接上;

我就在想是不是openssh禁止ssh  root用户;找到openssh的配置文件;

vim /etc/ssh/sshd_config

找到这一行

PermitRootLogin prohibit_password

改为:

PermitRootLogin yes

最后重启ssh服务

/etc/init.d/ssh restart

 

linux下ssh无法连接的原因

标签:安装   class   word   blog   pen   无法   创建   rest   password   

原文地址:http://www.cnblogs.com/codeAB/p/6395087.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!