Community discussions

MikroTik App
 
DottorT86
newbie
Topic Author
Posts: 36
Joined: Fri Aug 09, 2019 7:51 am

SSH RSA Mikrotik to Mikrotik not working

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:
user/ssh-keys/private/import private-key-file=admin_rsa user=admin
In the second Mikrotik (server) I imported the public key for the admin user:
user/ssh-keys/import public-key-file=admin_rsa.pub user=admin
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:
system/ssh address=x.x.x.x user=admin
after a few seconds I get the message "Welcome back!".
 
serafin
newbie
Posts: 33
Joined: Mon Nov 14, 2011 9:07 pm

Re: SSH RSA Mikrotik to Mikrotik not working

Fri Jul 28, 2023 10:30 pm

have you tried as below?
/ip ssh
set always-allow-password-login=yes
Ser@fin
 
DottorT86
newbie
Topic Author
Posts: 36
Joined: Fri Aug 09, 2019 7:51 am

Re: SSH RSA Mikrotik to Mikrotik not working

Sat Jul 29, 2023 8:38 am

Yes, using the password it works but I would like to use it with RSA without a password because I would like to use ssh-exec.
 
User avatar
mantouboji
Frequent Visitor
Frequent Visitor
Posts: 58
Joined: Mon Aug 01, 2022 2:21 pm
Location: Shanghai

Re: SSH RSA Mikrotik to Mikrotik not working  [SOLVED]

Sat Jul 29, 2023 3:24 pm

which version do you use?

7.8 is OK, 7.9 is broken, 7.10 is broken when import new private key, 7.11beta7 corrected .

Downgrade to 7.8, clear all private key, and re-import private key, and then upgrade to 7.10.2, will work.
 
DottorT86
newbie
Topic Author
Posts: 36
Joined: Fri Aug 09, 2019 7:51 am

Re: SSH RSA Mikrotik to Mikrotik not working

Mon Jul 31, 2023 6:49 pm

You're great!
I'm using 7.10.2 and it doesn't work but using 7.8 it's ok!
Thank you very much!!!