IntelliJ IDEA:SSH 连接错误“无法达成协议”,但在 Filezilla 中可以进行相同的连接

IntelliJ IDEA:SSH 连接错误“无法达成协议”,但在 Filezilla 中可以进行相同的连接

在项目连接对话框中单击“测试连接”时出现错误如下:

连接到“XXXXXX-ssh.services.easyname.eu”失败。无法达成和解:[diffie-hellman-group1-sha1、diffie-hellman-group-exchange-sha1] 和 [curve25519-sha256, [电子邮件保护]、ecdh-sha2-nistp256、ecdh-sha2-nistp384、ecdh-sha2-nistp521、diffie-hellman-group-exchange-sha256、diffie-hellman-group16-sha512、diffie-hellman-group18-sha512、diffie-hellman-group14-sha256、diffie-hellman-group14-sha1]

您知道这个错误意味着什么以及 IntelliJ 中是否有某些设置可以修复它?

答案1

我有同样的问题。

.IntelliJIdea2019.2/system/log/idea.log我看来

2019-09-22 13:43:58,474 [649136973]   WARN - z.sshj.transport.TransportImpl - Dying because - Unable to reach a settlement: [ssh-dss] and [rsa-sha2-512, rsa-sha2-256, ssh-rsa, ssh-ed25519] 
net.schmizz.sshj.transport.TransportException: Unable to reach a settlement: [ssh-dss] and [rsa-sha2-512, rsa-sha2-256, ssh-rsa, ssh-ed25519]
    at net.schmizz.sshj.transport.Proposal.firstMatch(Proposal.java:145)
    at net.schmizz.sshj.transport.Proposal.negotiate(Proposal.java:129)
    at net.schmizz.sshj.transport.KeyExchanger.gotKexInit(KeyExchanger.java:224)
    at net.schmizz.sshj.transport.KeyExchanger.handle(KeyExchanger.java:356)
    at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:503)
    at net.schmizz.sshj.transport.Decoder.decodeMte(Decoder.java:159)
    at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:79)
    at net.schmizz.sshj.transport.Decoder.received(Decoder.java:231)
    at net.schmizz.sshj.transport.Reader.run(Reader.java:59)

显然,这是因为客户端提供的 [ssh-dss] 和服务器列表 [rsa-sha2-512、rsa-sha2-256、ssh-rsa、ssh-ed25519] 不相交,因此协议无法就 ssh 的相互支持的算法达成一致。

我听从了https://intellij-support.jetbrains.com/hc/en-us/community/posts/360004370099-DataGrip-2019-2-RC-SSH-Tunnelling-no-longer-works来解决这个问题。

首先,我发现我有以下内容/etc/ssh/ssh_config

# Custom options from `extraConfig`, to override generated options


# Generated options from other settings
Host *
AddressFamily any

XAuthLocation /nix/store/mpa2k8as7sympa93rzvrvkmhrh6pnahi-xauth-1.0.10/bin/xauth


ForwardX11 no

PubkeyAcceptedKeyTypes +ssh-dss
HostKeyAlgorithms +ssh-dss

然后我将以下内容添加到~/.ssh/config

Host *
    HostKeyAlgorithms rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-ed25519

这解决了我的问题。

相关内容