Login Failures when script connects

Hi,

I have a script that runs from a linux server,connects to a mikrotik router and changes some firewall rules,it works but i’ve picked up that the following happens.(I have ssh kyes shared between the mikrotik router and the lunix server,so no need for passwords.).Say i do the following command from linux.

ssh -l username 10.90.12.10 /ip firewall nat set [find src-address=196.12.100.12] disabled='yes'

The command works and it disables all rules with src-address=192.12.100.12,which is fine,but if i chaeck the logs i see the following each time the above command gets executed.

08:38:59 system,error,critical login failure for user username from 192.12.100.1 via ssh 
08:39:00 system,info nat rule changed by username

I have made sure that the ssh command only gets executed once.Any idea what might cause this first login failure?

Thanks

Conrad

this is normal, ssh tries once first without authentication I believe. You should specify a password, or use a certificate and this should be fixed.

Hi,Thanks for the reply

ssh tries once first without authentication I believe

I dit not know this,as far as i know this is not normal ssh behaviour?Maybe an option to switch this off?

You should specify a password, or use a certificate and this should be fixed.

I believe i do have a certificate.I generated the ssh-keys in my server,and imported this to mikrotik,therefore no password is needed when connecting from that server,or am i missing the meaning of a certifcate.If so,how will i go about installing this certificate on the Mikrotik OS.

Thanks

I tried ssh with debug mode for “script mode” (writes login failures to log) and “session mode” (no login failures)
and only difference is following:

“session mode”
debug2: channel 0: request pty-req
debug2: channel 0: request shell

“script mode”
debug1: Sending command: /quit
debug2: channel 0: request exec

It looks like a bug :frowning: Maybe somebody from Mikrotik could comment this..

Pavel