当我尝试 ssh 时如何解决“找不到匹配的 mac 错误”答案

您所在的位置:网站首页 openssh哪个源有 当我尝试 ssh 时如何解决“找不到匹配的 mac 错误”答案

当我尝试 ssh 时如何解决“找不到匹配的 mac 错误”答案

2023-04-07 18:13| 来源: 网络整理| 查看: 265

在了解基础知识和根本原因之前,我已经为这个问题苦苦挣扎了很长时间。分享经验,以帮助他人。

我试图通过 ssh 连接到目标服务器并收到如下错误

$ ssh -A Unable to negotiate with XX.XX.XX.XX port 1234: no matching MAC found. Their offer: [email protected],[email protected], [email protected],hmac-sha2-512,hmac-sha2-256,[email protected]

此错误的根本原因是在您的源计算机上,支持的 MAC 不包含来自目标服务器的 MAC。

在你的机器上用命令行查看这个运行

$ ssh -Q mac # output would be something like hmac-sha1 hmac-sha1-96 hmac-sha2-256 hmac-sha2-512 hmac-md5 hmac-md5-96 [email protected] [email protected]

因此,现在为了使用他们选择的您的服务器不支持的 mac 连接到目标服务器,您必须明确提供目标服务器支持的 mac 之一。例如我们从错误信息中取出hmac-sha2-512并尝试连接,它会被连接

$ ssh -m hmac-sha2-512 -A

问题的另一个变体是密码不匹配,如下所示

$ ssh -A Unable to negotiate with XX.XX.XX.XX port 1234: no matching cipher found. Their offer: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc

根本原因是密码不匹配

通过

检查您支持的密码 $ ssh -Q cipher # output would be something like 3des-cbc aes256-cbc [email protected] aes128-ctr aes192-ctr aes256-ctr [email protected] [email protected]

因此,现在为了使用您的服务器不支持的密码选择连接到目标服务器,您必须明确提供目标服务器支持的密码之一。例如我们从错误信息中取出aes128-cbc并尝试连接,它会被连接

$ ssh -c aes128-cbc -A

可以找到更多细节 https://diego.assencio.com/?index=688f3a536f63c43566c94f0818d9ecf3

希望这对某人有所帮助。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3