Hello, I just upgraded my OS from Ubuntu 20.04 LTS to 22.04 LTS. Now I cannot login to my ROS 7.2.1 devices using an ssh agent. If I try this from any 20.04 OS (or Windows 10 + Putty), then it works. I have tried to connect with “-vvvv” option and this is what I see in the debug log:
debug1: Offering public key: /home/my_user/.ssh/id_rsa RSA SHA256:2******************************Y agent
debug1: send_pubkey_test: no mutual signature algorithm
What is causing this problem, and how can I fix it?
Newer linux distributions are depreciating some older host key and key exchange algorithms. They are still supported by ssh clients, but disabled by default. You can enable them by adding this to ${HOME}/.ssh/config (create file if it doesn’t exist already):
host <router name or IP address>
KexAlgorithms +diffie-hellman-group1-sha1
HostKeyAlgorithms +ssh-dss
And keep your RSA key handy, ROS ssh (still) doesn’t support newer ecdsa and ed25519 key types.
Host gulp
Hostname gulp.bach.redacted.com
Port 22
User paul
KexAlgorithms +diffie-hellman-group1-sha1
HostKeyAlgorithms +ssh-dss
PubkeyAcceptedAlgorithms +ssh-rsa
In my case, a new Ubuntu 22.04 server I migrated to wouldn’t use the identity file even though I was using the proper syntax. The -vv switch argument on the SSH command showed that the signature algorithm wasn’t being accepted. Create a new file in /etc/ssh/ssh_config.d, call it anything.conf, and as previously suggested add this one line: PubkeyAcceptedAlgorithms +ssh-rsa
It’s also possible to test this directly in your SSH command before creating the file by adding -o PubkeyAcceptedKeyTypes=+ssh-rsa as an additional option. Worked for me.
As @eworm mentioned on another thread, from router OS 7.7 the ed25519 keys are supported, from the changelog:
*) ssh - added support for Ed25519 key exchange;
*) ssh - do not allow SHA1 usage with strong crypto enabled;
*) ssh - fixed handling of non standard size RSA keys;
as highlited: Ed25519 is currently only supported for key exchange. Which doesn’t mean that Ed25519 public/private keys are supported (they still are not).