Error Remote Mikrotik Through Python Script

One of nice feature of Mikrotik is can be remoted through many ways one of them is by ssh, so i can create a python script using Paramiko as ssh client module but something strange when i want to create connection to mikrotik but it always fail although add parameters such as username, password and port are correct, in the mikrotik log shown this error message

[admin@Mikrotik] /log print

12:41:24 ssh,error expected: 50 got: 5
12:42:38 ssh,error expected: 50 got: 5

When i do some searching in google i found a solution in stackoverflow by adding argument  look_for_keys  with value False, here an example code that work for me

import paramiko

target = ''

ssh = paramiko.SSHClient()
ssh.connect(target, username='pigeon', password='kacangitem', look_for_keys=False)

stdin,stdout,stderr = ssh.exec_command('/log print')

2 thoughts on “Error Remote Mikrotik Through Python Script

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s