You need to explicitly re-enable the depreciated SHA1 RSA cipher "ssh_rsa" for RouterOS connections either in the global `/etc/ssh/ssh_config` (not sshd_config) or a user specific `~/.ssh/config` files. Add the following line to your connection stanza: (See my edit below)
Code: Select all
PubkeyAcceptedKeyTypes +ssh-rsa
Example extract from my `~/.ssh/config`:
Code: Select all
Host mikrotik1 mikrotik2 10.20.30.40
User admin
Port 22
Compression yes
TCPKeepAlive yes
NumberOfPasswordPrompts 1
ServerAliveInterval 60
StrictHostKeyChecking no
#Re-enable RSA SHA1 otherwise connection will fail (SHA1 depreciated)
PubkeyAcceptedKeyTypes +ssh-rsa
IdentityFile ~/.ssh/id_rsa
NOTE: OpenSSH etc have also sunset RSA & DSA keys and recommended to move over to ECDSA keys but none of my routers (RouterOS v6.49.10) appear to support ECDSA giving the following error:
Couldn't perform action - unable to load key file (wrong format?) ! (6)
Disabling the password after key restriction
If you want to disable the default of rejecting password SSH login's after loading SSH Keys, set the following to allow both Key & Interactive (password) login:
Code: Select all
/ip ssh set always-allow-password-login=yes
I hope this little tid bit saves a few bruised foreheads!