Hi everyone,
Just trying to do some ssh-exec from one MikroTik to another MikroTik using SSH key and I always get this error “failure: authentication failure”.
I have created a RSA key; uploaded both public and private key to local MikroTik and only public key to the remote device. Both devices have the same user with keys bound to them and also both are running 7.16.1 ROS.
I have also unchecked “Always Allow Password Login” from remote device.
Hi Patrikg,
I believe I do; and I’m able to SSH to my device using that private key from Windows or Linux but not from another MikroTik which either asks for password or shows authentication failure.
Using windows i see(yoda), maybe the files are treated different, you may not use the correct end line char then.
puttygen may produce wrong there for Mikrotik Linux way of end lines.
So if you take the file into some editor or use the Linux command dos2unix to convert the files.
You could also test to use the Linux command (ssh-keygen) to create the keys.
It has to do with the public key in the client side (Mikrotik device), because you get it working to connect from the pc with the private key. To the server side.
Yeah, I’ve watched it.
First, I tried using exported host keys; didn’t work.
Then I tried generating keys with “ssh-keygen -t rsa -b 2048” command; didn’t work, either.
I have created a special group with ssh-read-write as allowed policies.
After that, I created a user and assigned it to this group.
I’ve bound my keys to this user both on local and remote MikroTik devices.
Also as a test, I tried admin user who has full access for importing keys; but nothing works!
Do you self a favor and do it with the KISS method first.
With defaulted devices and only with the admin user.
And after it’s working, you do more and hardening your system.