升级openssh版本到8.2后,ssh登录出现Key exchange failed错误

系统版本:centos7.4

openssh版本:

[root@localhost ~]# rpm -qa|grep openssh
openssh-server-8.2p1-1.el7.centos.x86_64
openssh-8.2p1-1.el7.centos.x86_64
openssh-clients-8.2p1-1.el7.centos.x86_64
openssh-debuginfo-8.2p1-1.el7.centos.x86_64

使用CRT登录出现如下报错:

Key exchange failed。

No compatible hostkey.The server supports these methods:

RSA,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519

解决办法:

1、在/etc/ssh/sshd_config 文件添加如下信息

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

2、重启sshd服务

systemctl restart sshd

网上搜了很多解决办法,最终使用以上方法解决,随笔记录一下。

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值