Can't connect to Karaf Shell with SSH

troubleshooting
karaf

#1

Problem

When you try to connect to a Karaf Shell with SSH you get the error message:

Unable to negotiate with ::1: no matching host key type found. Their offer: ssh-dss

Diagnosis

This problem happens when you try to connect from a newer Linux distribution, such as Ubuntu 16.04+, to an older version of Karaf. The OpenSSH agent as disabled ssh-dss. You will find more legacy information which includes this issue on the OpenSSH Legacy Options page.

Solution

Connect to the Karaf shell by explicitly setting the host key algorithm to +ssh-dss:

ssh admin@<myKarafHost> -p 8101 -oHostKeyAlgorithms=+ssh-css

You can also create an SSH config file for your user with:

vi ~/.ssh/config

which has the following content:

Host <myKarafHost>
     HostKeyAlgorithms +ssh-dss

Karaf CLI Cheatsheet