如何修复 Mac 上的“未找到匹配的密钥交换方法”
时间:2022-03-22 15:54:28
这些是关于如何在 Mac 上尝试 SSH 时修复“未找到匹配的密钥交换方法”错误消息的说明。
尝试使用 macOS 通过 SSH 连接到旧服务器时,您可能会收到一条 ssh 错误消息,内容如下:
无法与 123.123.123.123 端口 22 协商:找不到匹配的密钥交换方法。
报错:diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
为了成功连接,OpenSSH 必须为每个参数至少提供一个相互支持的选择。如果客户端和服务器无法就一组相互参数达成一致,则连接将失败。在这种情况下,客户端和服务器无法就密钥交换算法达成一致。服务器提供了 diffie-hellman-group1-sha1,它受 OpenSSH 支持,但默认情况下不再启用。它被认为很弱并且在 Logjam 攻击的理论范围内。
有几种方法可以解决这个问题......
最简单的解决方案步骤1
重新尝试 SSH 连接,将以下内容添加到命令行:
Reattempt your SSH connection, adding the following to your command line:
-oKexAlgorithms=+diffie-hellman-group1-sha1
ie. ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 username@123.123.123.123
或者,您可以按照以下步骤使该选项永久化...
永久解决方案
步骤1
打开一个新的终端窗口
第二步
输入sudo nano ~/.ssh/config,然后在出现提示时输入您的管理密码。
第三步
将以下行添加到配置文件中,将 123.123.123.123 替换为您要连接的服务器的 IP。
主机 123.123.123.123
KexAlgorithms +diffie-hellman-group1-sha1
第四步
按Control+X退出。当询问是否保存修改后的缓冲区时输入Y。
点击Return确认要写入的文件名。
第五步
现在您可以像往常一样通过 SSH 连接到您的服务器。
ssh 用户名@123.123.123.123
意思就是如何修复 Mac 上的“未找到匹配的密钥交换方法”的内容,希望对你有所帮助。
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
腾讯会议在哪签到
![](https://img.aspxhome.com/file/2023/9/a341048_0s.png)
win11系统此站点的连接不安全怎么办?
![](https://img.aspxhome.com/file/2023/1/a274700_0s.jpg)
搜狗输入法有更便捷的输入中文数字或日期的方法?
![](https://img.aspxhome.com/file/2023/5/a317387_0s.png)
怎么关闭电脑版腾讯视频的推送消息?
![](https://img.aspxhome.com/file/2023/9/a341679_0s.png)
Win10文件夹中显示图片更多详细信息的操作方法
![](https://img.aspxhome.com/file/2023/26/a227666_0s.jpg)
PS如何制作镜头光晕效果?PS制作镜头光晕效果方法
![](https://img.aspxhome.com/file/2023/7/a327824_0s.png)
微软应用商店错误代码0xC002001B如何解决?
![](https://img.aspxhome.com/file/2023/1/a272890_0s.png)
aida64测试的数据怎么看_aida64测试cpu稳定性教程
Word 功能版块简介,文件、开始、插入、设计、布局等功能
![](https://img.aspxhome.com/file/2023/0/34240_0s.gif)
WPS如何对表格进行行列转置
![](https://img.aspxhome.com/file/2023/1/a164561_0s.jpg)
新年新气象,为您带来实现新年计划的APP
Windows 10成全球第二大系统!在中国无语
![](https://img.aspxhome.com/file/2023/4/a304472_0s.png)
excel几个表格合并到一个表
![](https://img.aspxhome.com/file/2023/7/a140717_0s.png)
excel中数字分隔符怎么调出来?
![](https://img.aspxhome.com/file/2023/9/36969_0s.jpg)
WPS Office手机版怎么找回丢失的文档
![](https://img.aspxhome.com/file/2023/7/a165427_0s.jpg)
wps office的批注怎么删除
![](https://img.aspxhome.com/file/2023/3/a168143_0s.jpg)
word表格数据如何快捷计算 word求和,求平均值等,而且也能像Excel那样进行批量计算哦
epic登录不上去是怎么回事?epic登录不上去怎么办?
![](https://img.aspxhome.com/file/2023/6/a322622_0s.jpg)