Git 错误:无法与 XX.XX.XXX.XXX 协商:找不到匹配的主机密钥类型。他们的报价:ssh-dss
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35233777/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git error: Unable to negotiate with XX.XX.XXX.XXX : no matching host key type found . their offer: ssh-dss
提问by Keith Ape
I am trying to connect to a repository that works through my VPN. I downloaded Git and when I try to clone the repo, I get this message:
我正在尝试连接到通过我的 VPN 工作的存储库。我下载了 Git,当我尝试克隆 repo 时,我收到以下消息:
Unable to negotiate with XX.XX.XXX.XXX : no matching host key type found . their offer: ssh-dss
Unable to negotiate with XX.XX.XXX.XXX : no matching host key type found . their offer: ssh-dss
Is there something I am missing?
有什么我想念的吗?
回答by Keith Ape
I have found the problem , The new OpenSSH versions disable the ssh-dss (DSA) public key algorithm. DSA was deemed too weak and OpenSSH community recommends against its use.
我发现了问题,新的 OpenSSH 版本禁用了 ssh-dss (DSA) 公钥算法。DSA 被认为太弱,OpenSSH 社区建议不要使用它。
If you see an error similar to this:
如果您看到与此类似的错误:
Unable to negotiate with 10.96.8.72: no matching host key type found. Their offer: ssh-dss
无法与 10.96.8.72 协商:找不到匹配的主机密钥类型。他们的报价:ssh-dss
...then you must re-enable the DSA keys by editing your ~/.ssh/config file to add the following line:
...然后您必须通过编辑您的 ~/.ssh/config 文件以添加以下行来重新启用 DSA 密钥:
HostkeyAlgorithms +ssh-dss
You may need to create the ~/.ssh/config file if it does not already exist.
如果 ~/.ssh/config 文件尚不存在,您可能需要创建它。
After creating the file, you must restrict access permissions:
创建文件后,您必须限制访问权限:
chmod 600 ~/.ssh/config
and then do the clone. That should work perfectly fine!
然后进行克隆。那应该工作得很好!
回答by iveqy
You're trying to clone over the ssh-protocol. The ssh server on the other side require you to use a dss key authentication, but your ssh client that git uses doesn't have access to one, probably because you haven't created one.
您正在尝试通过 ssh 协议进行克隆。另一端的 ssh 服务器要求您使用 dss 密钥身份验证,但是 git 使用的 ssh 客户端无权访问,可能是因为您尚未创建。
How you create a key depends on which ssh client and what operating system you're using.
创建密钥的方式取决于您使用的 ssh 客户端和操作系统。
When you create a key, you're actually creating a keypair, with one private key and one public key. The public key must be known by the server for the server to be able to authenticate you.
创建密钥时,实际上是在创建密钥对,其中包含一个私钥和一个公钥。服务器必须知道公钥才能对您进行身份验证。
How you add your public key to the servers ssh-server, depends on which ssh server that is used (or which git hosting software that wraps the ssh server).
如何将公钥添加到服务器 ssh-server,取决于使用的 ssh 服务器(或包装 ssh 服务器的 git 托管软件)。