SSH RSA Mikrotik to Mikrotik not working
Posted: Fri Jul 28, 2023 6:57 pm
Hi everybody,
As you can guess from the title I have a problem connecting two Mikrotik using SSH with RSA inside Winbox.
I did a lot of tests and I try to summarize them.
I generated the RSA key pair with PuTTY Key Generator:
Type of key generated: RSA
Number of bits in generated key: 2048
I exported both the public key and the private key (I tried to export the private key both with and without the password but nothing changed).
I exported the private key in both PPK and OpenSSH format.
I configured the two Mikrotiks with the same "admin" account and "12345678" password.
In the first Mikrotik (client) I imported the private key for the admin user:
In the second Mikrotik (server) I imported the public key for the admin user:
If I connect to the "server" from a PC using PuTTY and the PPK key I am able to connect.
Instead, when I connect to the "server" from the Mikrotik "client" I am immediately disconnected.
If I try to connect from Tools->Telnet->SSH the window opens and immediately says "Disconnected".
If I try to connect from terminal:
after a few seconds I get the message "Welcome back!".
As you can guess from the title I have a problem connecting two Mikrotik using SSH with RSA inside Winbox.
I did a lot of tests and I try to summarize them.
I generated the RSA key pair with PuTTY Key Generator:
Type of key generated: RSA
Number of bits in generated key: 2048
I exported both the public key and the private key (I tried to export the private key both with and without the password but nothing changed).
I exported the private key in both PPK and OpenSSH format.
I configured the two Mikrotiks with the same "admin" account and "12345678" password.
In the first Mikrotik (client) I imported the private key for the admin user:
Code: Select all
user/ssh-keys/private/import private-key-file=admin_rsa user=admin
Code: Select all
user/ssh-keys/import public-key-file=admin_rsa.pub user=admin
Instead, when I connect to the "server" from the Mikrotik "client" I am immediately disconnected.
If I try to connect from Tools->Telnet->SSH the window opens and immediately says "Disconnected".
If I try to connect from terminal:
Code: Select all
system/ssh address=x.x.x.x user=admin