Navicat连接ssh报错 kex error : no match for method kex algos: server [diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1], c

昨天 23:30 字数 1356 阅读 10

如题,换了新电脑之后使用Naivat连接远程数据库报错如下,macOS系统版本、系统openSsh版本、Navicat版本都和原电脑一直的情况下仍旧报错

Navicat连接ssh报错 kex error : no match for method kex algos: server [diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1], client [ecdh-sha2-nistp256] (-1)

两种解决办法

方法一

修改 cat /etc/ssh/crypto.conf文件如下,注意 Ciphers、KexAlgorithms 注释掉的是原配置

➜  ~ cat /etc/ssh/crypto.conf

# Default algorithms favoring higher-performance FIPS algorithms
# in most cases.
#
# To configure these SSH algorithms, run the following command:
#
# sudo ln -fs crypto/apple.conf /etc/ssh/crypto.conf
#

# Ciphers ^aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ciphers ^aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes128-ctr

# KexAlgorithms ^ecdh-sha2-nistp256
KexAlgorithms ^ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

MACs ^hmac-sha2-256-etm@openssh.com,hmac-sha2-256

很多人用这个方法解决了问题,但是我的Navicat客户端似乎有点任性,它不读取这个配置,所以这个方法对我没用,最终我使用了下面的方法解决问题

方法二

修改 ~/.ssh/config,增加如下配置

Host 123.123.123.123 # 你的服务器Ip
    HostName 123.123.123.123 # 你的服务器Ip
    KexAlgorithms +diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256
    Ciphers +aes256-ctr,aes128-ctr
    PubkeyAcceptedKeyTypes +ssh-rsa

虽然 Navicat 不读系统的 crypto.conf,但作为标准的 SSH 客户端,它在建立 SSH 连接时,普遍会去读取你用户家目录下的个人配置文件 ~/.ssh/config。

0人点赞>
关注 收藏 改进 举报
0 条评论
排序方式 时间 投票
快来抢占一楼吧
请登录后发表评论
站长 @ 十七度
文章
399
粉丝
24
喜欢
200
收藏
32
排名 : 1
访问 : 188.07万
私信