【Linux常见问题】SecureCRT 终端连接密钥交换失败错误

时间:2024-02-22 14:05:22

SecureCRT 终端软件连接linux操作系统,出现如下错误:

英文描述:Key exchange failed. No compatible key exchange method. The server supports these methods: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256

中文描述:密钥交换失败。没有兼容的密钥交换方法。服务器支持以下方法:ecdh-sha2-nistp256、ecdh-sha2-nistp384、ecdh-sha2-nistp521、diffie-hellman-group-exchange-sha256

解决方法:

//使用root用户,变更ssh客户端配置
cd /etc/ssh
vi ssh_config
//取消如下两行注释
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160

//使用root用户,变更ssh服务端配置. vi sshd_config
复制上述两行到sshd_config中。
如果有其它密钥交换语句,则注释掉。
//重启系统
reboot