ssh 连接报错:Unable to negotiate with 192.168.xx.xx port 22: no matching key exchange method found.

ssh 连接 Linux 服务器时,很偶然的情况下出现了如下报错:

Unable to negotiate with xx.xx.xx.xx port 22: no matching key exchange method found.
Their offer:diffie-hellman-group1-sha1

大概的原因是 ssh 客户端不支持 ssh-rsa 算法,如果要解决报错需要手动修改本地配置,指定具体的 ssh-rsa 算法。

解决方案

新建 ~/.ssh/config 文件:

touch ~/.ssh/config
vi ~/.ssh/config

手动添加如下内容:

Host 192.168.xx.xx
    KexAlgorithms +diffie-hellman-group1-sha1

猜你喜欢

转载自blog.csdn.net/yilovexing/article/details/128797711