热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Theclienthasdisconnectedfromtheserver.Reason:解决

SecureCRT连接SSH时报错错误一:UnabletoauthenticateTheclienthasdisconnectedfromtheserver.Reason:Unab


SecureCRT连接SSH时报错


错误一:Unable to authenticate


The client has disconnected from the server.Reason:
Unable to authenticate using any of the configured authentication methods.

意思是无法进行身份验证,这个错误信息比较模糊,无法马上确定,排查可能是以下原因导致:


  1. SSH客户端没有开启密码验证
  2. 或者SSH服务端不允许密码验证
  3. 也有可能是SSH Keys错误(丢失/损坏/不匹配)

换用Terminal SSH连接

这么做是因为我之前一直是用SecureCRT正常连接的,最近才开始报这个错,所以很可能是SecureCRT的本地连接数据出了问题,而换用Terminal连接则可排除这个问题。




如果出现了登录login输入,则说明确定是SecureCRT问题,这时候只要删除SecureCRT里的连接重新建立一个就可解决。如果没问题login继续往下看。


确认SSH配置

检查/etc/ssh/sshd_configPasswordAuthentication yes,去掉注释,保存,重启ssh服务:service sshd restart

再尝试连接,如果错误消失,解决,否则继续下面。


因为访问权限被拒绝

登陆服务器查看auth.log




解决办法:chmod 600  /home/user/.ssh/authorized_keys,这里根据你的日志来。


SSH证书不匹配

一般不会是这个原因,但如果以上的方法都无用,你需要把pem证书转为pub证书,并手动指定路径,问题解决。


错误二:Protocol version mismatch


The client has disconnected from the server. Reason:
Protocol version mismatch. Required protocol version is 1.3 - 1.99. Received version was 2.0.

提示很明确,是连接协议版本不匹配,解决方法修改成SSH2就行:


The client has disconnected from the server.  Reason:解决


推荐阅读
author-avatar
qqq
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有