I am trying to create a git repository on my web host and clone it on my computer. Here's what I did:html
ssh-keygen -t dsa
.~/.ssh
.And then, after an attempt to run the command git clone ssh://user@host/path-to-repository
, I get an error:git
Unable to negotiate with XX.XXX.XX.XX: no matching host key type found. Their offer: ssh-dss
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.web
What does that mean?ssh
Answer:ide
1)idea
The recent openssh version deprecated DSA keys by default. You should pursuit your GIT provider to add some reasonable host key. Relying only on DSA is not a good idea.code
As a workaround, you need to tell your ssh
client that you want to accept DSA host keys, as described in the official documentation for legacy usage. You have few possibilities, but I recommend to add these lines into your ~/.ssh/config
file:server
Host your-host HostkeyAlgorithms +ssh-dss
2)htm
You can also add -oHostKeyAlgorithms=+ssh-dss
in your ssh line:
ssh -oHostKeyAlgorithms=+ssh-dss user@host