You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

两台相同Ubuntu 20.04 LTS服务器间SSH连接提示“no matching key exchange method found”的问题求助

两台相同Ubuntu 20.04 LTS服务器间SSH连接提示“no matching key exchange method found”的问题求助

我有两台完全相同的Ubuntu 20.04 LTS服务器(其中一台是另一台在VMware里的克隆机),但尝试从一台通过SFTP或SSH连接到另一台时,总会弹出这个错误:

no matching key exchange method found.

Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,kex-strict-s-v00@openssh.com

不管是从A连B还是B连A,问题都一样,有没有大佬能帮忙看看?


UPDATE 3

我在服务器上执行了这条命令来查看加密套件:

ewessel@unifyed-new-db:~$ sudo sshd -T | grep ciphers | perl -pe 's/,/\n/g' | sort -u
aes128-ctr
aes128-gcm@openssh.com
aes192-ctr
aes256-ctr
aes256-gcm@openssh.com
ciphers chacha20-poly1305@openssh.com

UPDATE 2

后来我在两台机器的/etc/ssh/sshd_config.d/目录里,发现了一个叫weak.conf的文件,里面写着:

KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

UPDATE 1

下面是连接过程中的详细日志(原内容未完整展示):


备注:内容来源于stack exchange,提问作者Eric W

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 11:48:04