Git error: Unable to negotiate with XX.XX.XXX.XXX : no matching host key type found . their offer: ssh-dss

24,722

Solution 1

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.

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

...then you must re-enable the DSA keys by editing your ~/.ssh/config file to add the following line:

HostkeyAlgorithms +ssh-dss

You may need to create the ~/.ssh/config file if it does not already exist.

After creating the file, you must restrict access permissions:

chmod 600 ~/.ssh/config

and then do the clone. That should work perfectly fine!

Solution 2

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.

How you create a key depends on which ssh client and what operating system you're using.

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).

Share:
24,722
Keith Ape
Author by

Keith Ape

Updated on February 06, 2020

Comments

  • Keith Ape
    Keith Ape over 4 years

    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:

    Unable to negotiate with XX.XX.XXX.XXX : no matching host key type found . their offer: ssh-dss

    Is there something I am missing?