I get the error "no matching host key type found. Their offer: ssh-rsa" when trying to connect with SSH
Overview
- The error occurs when using Android 8.1 or below images.
- The images run an old SSH server version.
- The old SSH server requires extra settings when using OpenSSH 8.8 or newer clients.
- The error should not occur on Android 9.0 or higher.
- If the current image is Genymotion Device Image older than 13.2.0, upgrade to 14.0.0 or higher if possible.
- New releases include important bug fixes and critical security fixes.
Note
- Android 9.0 or higher should not trigger this issue.
- If the Android image is from Genymotion Device Image older than 13.2.0, upgrade to 14.0.0 or higher if possible; new releases include important bug fixes and critical security fixes.
Workarounds
- To work around the issue, add the options -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa to the ssh command.
For example:
ssh -i key.pem shell@3.252.167.165 -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa
- You can also add the following to your ssh config file, /etc/ssh/ssh_config:
HostKeyAlgorithms = +ssh-rsa
PubkeyAcceptedAlgorithms = +ssh-rsa
- Another option is to use a different algorithm when creating your key pair.
- Please refer to your Cloud provider documentation for supported algorithms.
Related articles
- Starting a virtual device fails with "VBoxHeadless.exe - Application Error. [...] The memory could not be read."
- How to connect a Genymotion Device Image (PaaS) instance to any IDE?
- How to uninstall Genymotion Desktop completely (purge)?
- How to install Magisk on Genymotion?
- How to create and setup a STUN/TURN server on AWS?