系统版本: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
网上搜了很多解决办法,最终使用以上方法解决,随笔记录一下。