Solved: Error: Unable to negotiate with — port 22: no matching host key type found. Their offer: ssh-dss ?
In this article, we will see a common error message and its resolution.
I. Error Message
ngeaix001 saket $ ssh Administrator@10.254.0.56 Unable to negotiate with 10.254.0.56 port 22: no matching host key type found. Their offer: ssh-dss ngeaix001 saket $
Here we can see when we try to do ssh on an address, it says, not able to negotiate with matching host key.
It means the host key is different on the target server and its shown ssh-dss.
II. Solution
Hence we need to connect by sending ssh-dss key pair.
We can achieve this by changing our key algorithm while doing ssh like below.
ngeaix001 saket $ ssh -oHostKeyAlgorithms=+ssh-dss Administrator@10.254.0.56 Administrator@10.254.0.56's password: User:Administrator logged-in to NGEAIX9-rb.ngel.linux.net(10.254.0.56 / FE80::2A92:4AFF:FE34:AC18) iLO 3 Advanced 1.82 at Jan 15 2015 Server Name: NGEAIX9 Server Power: On </>hpiLO->
Hence now we are able to connect with the server and issue is now resolved.
still not working
ssh -oHostKeyAlgorithms=+ssh-dss 149.130.1.5
command-line line 0: Bad protocol 2 host key algorithms ‘+ssh-dss’.
[hs103@junco ~]$
Can you Verify your openssh version:
# ssh -V
Also please run below command and check if any output:
# grep -i “ssh-dss” /etc/ssh/ssh* ~/.ssh/config
We need to comment below line by placing # in front of it:
HostKeyAlgorithms +ssh-dss.
thanks a lot! You saved me man.
Informative content