拓扑讲解:
SW1、SW2能相互ping通,但无法SSH到对方。
报错问题:
%SSH-3-NO_MATCH: No matching mac found: client hmac-sha1,hmac-sha1-96 server hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-512
[Connection to 192.168.1.2 aborted: error status 0]
*No matching mac found 找不到匹配的mac 查找相关命令需要关于ssh的mac算法
造成原因:
其中有一台设备的版本比较老,加密和验证方式与新版本的加密和验证方式不同
验证方式:
查看命令: ip ssh server algorithm mac ?
SW1(config)#ip ssh server algorithm mac ?
hmac-sha1 HMAC-SHA1 (digest length = key length = 160 bits)
hmac-sha1-96 HMAC-SHA1-96 (digest length = 96 bits, key length = 160 bits)
SW2(config)#ip ssh server algorithm mac ?
hmac-sha2-256 HMAC-SHA2-256 (digest length = 256 bits, key length = 256 bits)
hmac-sha2-256-etm@openssh.com HMAC-SHA2-256-ETM (digest length = 256 bits, key length = 256 bits)
hmac-sha2-512 HMAC-SHA2-512 (digest length = 512 bits, key length = 512 bits)
hmac-sha2-512-etm@openssh.com HMAC-SHA2-512-ETM (digest length = 512 bits, key length = 512 bits)
解决方法:
升级 or 替换 设备
临时解决方法:
添加设备(该设备包含新、老设备的SSH的MAC算法)
拓扑讲解:
SW1、SW2能相互ping通,但无法SSH到对方。新添加一台SW3,且能与SW1、SW2相互ping通,SW3能分别远程到SW1、SW2。
SW3的作用:当作SW1 SSH远程到SW2的跳板
SSH过程:SW1 - - > SW3 - - > SW2
查看验证情况:
SW1(config)#ip ssh server algorithm mac ?
hmac-sha1 HMAC-SHA1 (digest length = key length = 160 bits)
hmac-sha1-96 HMAC-SHA1-96 (digest length = 96 bits, key length = 160 bits)
SW3(config)#ip ssh server algorithm mac ?
hmac-sha1 HMAC-SHA1 (digest length = key length = 160 bits)
hmac-sha1-96 HMAC-SHA1-96 (digest length = 96 bits, key length = 160 bits)
hmac-sha2-256 HMAC-SHA2-256 (digest length = 256 bits, key length = 256 bits)
hmac-sha2-512 HMAC-SHA2-512 (digest length = 512 bits, key length = 512 bits)
SW2(config)#ip ssh server algorithm mac ?
hmac-sha2-256 HMAC-SHA2-256 (digest length = 256 bits, key length = 256 bits)
hmac-sha2-256-etm@openssh.com HMAC-SHA2-256-ETM (digest length = 256 bits, key length = 256 bits)
hmac-sha2-512 HMAC-SHA2-512 (digest length = 512 bits, key length = 512 bits)
hmac-sha2-512-etm@openssh.com HMAC-SHA2-512-ETM (digest length = 512 bits, key length = 512 bits)
*SW3有SW1的 hmac-sha1、hmac-sha1-96算法
*SW3有SW2的 hmac-sha2-256、hmac-sha2-512算法
所以SW3可以分别SSH远程到SW1、SW2