解决:no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

时间:2025-02-23 09:51:58

第一种方法,在当前用户的.ssh目录下新建config文件,如当前用户为root

vi  ~/.ssh/config
Host *
KexAlgorithms +diffie-hellman-group1-sha1

此方法只对当前用户生效,使用其他用户是又会报错。

 

第二种方法,修改/etc/ssh/ssh_config文件,在最末尾加入即可。

KexAlgorithms +diffie-hellman-group1-sha1