故障案例:SecureCRT的SSH登录页面显示Key exchange failed
适用产品和版本
ALL
现象描述
算法不匹配导致问题,客户端显示如下:
Key exchange failed. No compatible key exchange method. The server supports these methods: diffie-hellman-group-exchange-sha256 No compatible hostkey. The server supports these methods: rsa-sha2-512,rsa-sha2-256, No compatible cipher. The server supports these ciphers: des-cbc No compatible MAC. The server supports these MACs: hmac-sha2-256-96
客户端显示当前key exchange、hostkey、cipher、MAC四种算法支持的类型均不匹配,并显示服务器所支持的类型。
当前算法涉及key exchange、hostkey、cipher、MAC四种算法。
SecureCRT算法显示的机制:算法不匹配,会显示服务器的算法支持的列表;算法匹配,不会报错。例如,客户端和服务器能匹配上MAC算法,则客户端不会显示No compatible MAC,此时只需要解决No compatible对应的算法即可。
相关告警与日志
%%01SSH/4/SSH_FAIL(s)[0]:Failed to login through SSH. (IP=120.63.81.222, VpnInstanceName= , UserName=, Times=1, FailedReason=Failed to negotiate the encryption algorithm)
原因分析
算法不匹配。
操作步骤
通过SecureCRT会话选项查看算法列表。
key exchange算法的支持情况:
hmac算法和chiper算法的支持情况:
查看设备ssh的配置,是否配置了SSH算法列表。如果没有配置,即采用默认的执行的算法列表。
可以通过命令或者产品文档确定设备支持的算法列表。此处的显示信息仅为示意,具体设备支持的算法,以设备命令行的在线帮助为准。
[HUAWEI] display current-configuration | include sshssh server cipher aes128_ctr ssh server key-exchange dh_group14_sha256 ssh server publickey rsa_sha2_512 ssh server hmac sha1 [HUAWEI] ssh server hmac ? sha2_256 SHA2-256 HMAC algorithm, and this algorithm is recommended [HUAWEI] ssh server cipher ? aes128_ctr AES128 encryption algorithm in CTR mode aes256_ctr AES256 encryption algorithm in CTR mode, and this algorithm is recommended [HUAWEI] ssh server key-exchange ? dh_group14_sha1 Diffie-hellman-group14-sha1 key exchange algorithm dh_group14_sha256 Diffie-hellman-group14-sha256 key exchange algorithm dh_group15_sha512 Diffie-hellman-group15-sha512 key exchange algorithm dh_group16_sha512 Diffie-hellman-group16-sha512 key exchange algorithm dh_group1_sha1 Diffie-hellman-group1-sha1 key exchange algorithm dh_group_exchange_sha1 Diffie-hellman-group-exchange-sha1 key exchange algorithm dh_group_exchange_sha256 Diffie-hellman-group-exchange-sha256 key exchange algorithm, and this algorithm is recommended ecdh_sha2_nistp256 Ecdh-sha2-nistp256 key exchange algorithm ecdh_sha2_nistp384 Ecdh-sha2-nistp384 key exchange algorithm ecdh_sha2_nistp521 Ecdh-sha2-nistp521 key exchange algorithm [HUAWEI] ssh server publickey ? dsa DSA public key algorithm ecc ECC public key algorithm rsa RSA public key algorithm rsa_sha2_256 RSA SHA2-256 public key algorithm rsa_sha2_512 RSA SHA2-512 public key algorithm
根据SecureCRT支持的算法列表,在设备上配置对应的算法列表。
如果客户端可配置支持的算法列表并没有设备侧支持的算法,在设备上执行WEAKEA插件,配置支持其他双方都支持的算法列表。
例如,SecureCRT显示key exchange不匹配:
No compatible key exchange method. The server supports these methods: diffie-hellman-group-exchange-sha256
服务器支持的算法为diffie-hellman-group-exchange-sha256,客户端SecureCRT支持diffie-hellman-group14-sha1、diffie-hellman-group-exchange-sha1、diffie-hellman-group1-sha1,可以在设备侧配置ssh server key-exchange dh_group_exchange_sha1 dh_group14_sha1 dh_group1_sha1,将客户端支持的算法配置在设备上。
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/8215.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~