无法与 __IP_ADDRESS_ 端口 22 协商:未找到匹配的主机密钥类型。他们的报价:ssh-rsa,ssh-dss

Sti*_*ere 12 git rsa intellij-idea git-clone phpstorm

在 PhpStorm 中使用 git clone 时,我收到一条错误消息:

克隆失败
无法与 IP 地址端口 22 协商:未找到匹配的主机密钥类型。他们的报价:ssh-rsa,ssh-dss
无法从远程存储库读取。
请确保您拥有正确的访问权限并且存储库存在。

然后我制作了自己的 RSA 密钥并将其保存在我的计算机上;还在我想要获取 git clone 的服务器上(通过服务器主机)注册了它。我还降级了最新的 PhpStorm 版本。作为最后的手段,我还重置了计算机并重新安装了 PhpStorm。

但我的 PhpStorm 事件日志中仍然有该错误消息。

另外,当我第一次获得 PhpStorm 时,我可以轻松成功克隆,但几天后突然,我得到了类似的事件日志条目。

我能得到一个关于这个问题的解决方案吗,OTL

小智 39

在 Linux/Ubuntu 上,我添加了以下几行/etc/ssh/ssh_config

    PubkeyAcceptedAlgorithms +ssh-rsa
    HostkeyAlgorithms +ssh-rsa
Run Code Online (Sandbox Code Playgroud)

我想将相同的行放在/etc/ssh/ssh_config.d.


Ant*_*eno 21

添加PubkeyAcceptedAlgorithms +ssh-rsaHostkeyAlgorithms +ssh-rsa属性。

nano ~/.ssh/config
Run Code Online (Sandbox Code Playgroud)
Host hostname_of_machine
    HostName hostname_or_ip_address
    User root
    IdentityFile ~/.ssh/file.pem
    IdentitiesOnly yes
    PubkeyAcceptedAlgorithms +ssh-rsa
    HostkeyAlgorithms +ssh-rsa
Run Code Online (Sandbox Code Playgroud)


小智 5

这是因为OpenSSH 已弃用 ssh-rsa
要启用它,请添加-oHostKeyAlgorithms=+ssh-rsa到您的命令中。


Von*_*onC 0

检查(如此处所示)使用不带密码的私钥是否可以改善情况。

另请检查settings>Version Control>git >SSH Executable:尝试使用系统而不是“本机”,并仔细检查您的%PATH%(Windows) 或$PATH(Linux/Mac)。

在 Windows 上,我会确保C:\Program files\Git\usr\bin\ssh.exe优先。