I get the error "no matching host key type found. Their offer: ssh-rsa" when trying to connect with SSH

This error happens when using Android 8.1 or below images. These images use an old version of ssh server which requires extra settings when using OpenSSH >= 8.8 ssh clients.

> Note: This should not happen with Android 9.0 or higher. If this is the case, it probably means that your instance is using an old version of Genymotion Device Image (<13.2.0). Please upgrade your instance(s) to ver.14.0.0 or higher if possible. new releases include important bugs and critical security fixes.

Workaround: add ssh options to your SSH command

Alternatively, you can workaround this issue by adding the options -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa to your ssh command.

For example:

ssh -i key.pem shell@3.252.167.165 -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa

Workaround: add settings to your SSH config file

You can also add the following in your ssh config file, /etc/ssh/ssh_config:

HostKeyAlgorithms = +ssh-rsa
PubkeyAcceptedAlgorithms = +ssh-rsa

Alternative: use a different algorithm when creating your key pair

Another option is to use a different algorithm when creating your key pair.

Please refer to your Cloud provider documentation for supported algorithms.

Source: https://support.genymotion.com/hc/en-us/articles/9500420360093-I-get-the-error-no-matching-host-key-type-found-Their-offer-ssh-rsa-when-trying-to-connect-with-SSH

Keywords: Genymotion, SSH, OpenSSH, HostKeyAlgorithms, PubkeyAcceptedAlgorithms, ssh-rsa