Troubleshooting
Problem
ssh client rejects the ssh-rsa host key algorithm offered by the ssh server, causing logins to fail. This happens if there are no other matching host key algorithms offered by the ssh server.Symptom
ssh command prints this error message.Unable to negotiate with XXX.XXX.XXX.XXX port 22: no matching host key type found. Their offer: ssh-rsa
Cause
ssh-rsa host key algorithm was disabled in OpenSSH 8.8. This is because it uses the SHA-1 hash algorithm, which is not secure.ssh-rsa host key algorithm with the ssh-rsa key type. Although they are referred to by the same name, the host key algorithm implies a hash algorithm, whereas the key type has no associated hash algorithm. RSA host keys are still fully supported.ssh-rsa key type:ssh-rsa, which uses theSHA-1hash algorithm.rsa-sha2-256, which uses theSHA-2256-bit hash algorithm.rsa-sha2-512, which uses theSHA-2512-bit hash algorithm.
rsa-sha2-256 and rsa-sha2-512 algorithms are fully supported.Environment
Resolving The Problem
SHA-2 host key algorithms on the ssh server. Very old ssh servers may not support these algorithms. In OpenSSH, add the following option to the /etc/ssh/sshd_config file on the ssh server.HostKeyAlgorithms +rsa-sha2-512,rsa-sha2-256
stopsrc -s sshd startsrc -s sshd
ssh-rsa host key algorithm on the ssh client. Do this by adding the following option to the /etc/ssh/ssh_config or $HOME/.ssh/config file.
HostKeyAlgorithms +ssh-rsa
ssh-rsa host key algorithm uses the SHA-1 hash algorithm, which is not secure. Only use it as a last resort.|
SUPPORT: If the instructions in this document do not lead to resolution of the problem, follow these instructions to open a case. The product must be under warranty or have an active and valid support contract. a. Document or take screen captures of all symptoms, errors, or messages. b. Capture any logs or data relevant to the issue. c. Contact IBM® to open a case. -For electronic support, visit the IBM Support Community: d. Provide a detailed description of the issue and a reference to this technote. e. Upload all of the details and data to the case. -You can attach files to the case in the IBM Support Community, or http://www.ibm.com/support/docview.wss?uid=ibm10733581 f. Click here to submit feedback for this document. |
Related Information
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
13 May 2024
UID
ibm17118459