I am accustomed to using Putty on a Windows box or an OSX command line terminal to SSH into a NAS, without any configuration of the client.
Ubuntu 16.04 attempts to SSH into the NAS (via LAN):
ssh [email protected]
Unable to negotiate with 192.168.8.109 port 22: no matching host key type found. Their offer: ssh-dss
- Is this result / response intentional?
- Is there a simple correction that enables SSH access to the NAS?
The version of OpenSSH included in 16.04 disables ssh-dss. There's a neat page with legacy information that includes this issue: http://www.openssh.com/legacy.html
In a nutshell, you should add the option
-oHostKeyAlgorithms=+ssh-dss
to the SSH command:You can also add a host pattern in your
~/.ssh/config
so you don't have to specify the key algorithm every time:This has the added benefit that you don't need to type out the IP address. Instead,
ssh
will recognize the hostnas
and know where to connect to. Of course you can use any other name in its stead.If you came here because Bitbucket returns the following after an update to OpenSSH 8.8:
you should NOT enable DSS (like in the accepted answer), but rather RSA in
~/.ssh/config
:Reference: https://community.atlassian.com/t5/Bitbucket-articles/OpenSSH-8-8-client-incompatibility-and-workaround/ba-p/1826047
Note that
PubkeyAcceptedKeyTypes
is a backwards compatible alias toPubkeyAcceptedAlgorithms
which has been suggested in the article. If you use it, the same configuration can be used with older OpenSSH client versions, e.g. if you share the config with docker containers.You can do the same for other hosts, or use
Host *
to allow RSA for any host.Editing the ~/.ssh/config file is the best option. If you have a number of hosts to connect to on the same subnet you can use the following method to avoid entering each host in the file:
This works great for me as I have a number of Brocade switches to manage and they started complaining about the Host key after I moved to Ubuntu 16.04.
If you want to use newer OpenSSH to connect to deprecated servers:
Add -v if you want to see what's happening, and -o HostKeyAlgorithms=ssh-dss if it still doesn't work:
You can also, of course, edit /etc/ssh/ssh_config or ~/.ssh/ssh_config, and add:
https://forum.ctwug.za.net/t/fyi-openssh-to-access-rbs-openssh-7/6069 mentions the following fix on Mikrotik Routerboards:
(Nothing this here because this answer also comes up on web searches when looking for a similar error message.)
This worked:
add to new empty line:
It was NOT needed to reload/restart SSHd.
ssh -v
also shows additional details if needed.For me this added into
.ssh\config
worked:Running this one-liner on client worked to workaround the issue: