Can't connect to Karaf Shell with SSH


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


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.


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
1 Like