Hi everyone,
I need some help, so I want my MT Router (2.9.50) to Connect via SSH to another MT Router (2.9.50) to send some command (say run some script or something like that).
Can You Help Me ?
I have tried this setup connecting from linux. My SSH had no password and it was working very Well.
Now I need to do this Setup, Please Help, I can not write the expresion right, inorder it works.
I have tried, but no use,
I could not even create a session,
Try using this for getting pptp-server client-address,
:global malibuIP [/interface pptp-server get [/interface pptp-server find user=Mag ] client-address ]
:log error $malibuIP
Look the MikroTik Support Center Has Answered to My question.
Hello,
you cannot execute remote commands through ssh from router, you can do that
from any other linux host that is available to you.
also access to router without password is not advised to, as a better practice
use key to log in remotely through ssh and in your script point to a key file,
so your router is protected.
Regards,
Janis
I think We have to find another way to solve this proble.
Thanks With Best Regards
Karapet Aznavuryan
First of All You have to generate public key, and then You can use say such command
PPP active print
You must put the same key in your mikrotik router,
user ssh-keys import file="your pub key "
running
ssh 192.168.250.250 -l admin -i .ssh/id_dsa /ppp active print
As MT3.x got a basic http/ftp client (/tool fetch)
it is possible that remote router will have a script scheduled every some period of time that will do:
Download script file from remote location
run that script
if you want results from remote router like stats, logs, signals etc… you can use SSH with RSA/DSA keys to avoid login and password. that can be done easly from linux, never tried it from MT to MT but i believe if MT boxes will have pairs of public/prvate should work the same.
Other option is to write s simple script to get few values and send it via remote syslog to a Linux machine. and use a script on linux machine to check syslog and take action depends what is in syslog.
Answer for “How to do it” depends “What do you want”