I would like to MAC Telnet in scripts, don’t you?
with private + public keys installed, what’s the difference with ssh?
Can you SSH with scripts or API? I’ve tried without success.
That’s a good question…
So tried, and you can.
- Created keys (pub + priv): see https://wiki.mikrotik.com/wiki/Use_SSH_to_execute_commands_(DSA_key_login)#Configuration
- imported pub in target system: see previous link
- imported pub+priv in source system: see https://wiki.mikrotik.com/wiki/Manual:System/SSH_client#Log-in_using_certificate
- created script with within ssh call “/system ssh 192.168.48.11 “/ip ad pr””
=> it run just fine
[admin@MikroTik] > /system script run remoteExec
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK INTERFACE
0 192.168.48.11/24 192.168.48.0 ether1
Welcome back!
[admin@MikroTik] >
Sometimes I have to change parameters for clients connected to a PTMP, but with PPPoE server on another RB, I don’t know which client is on that PTMP, so MAC Telnet in script would be useful in that case
well, if you deploy the public key to all clients and attach to a user, you could exec commands remotely
For telnet, it’s asking (interactively) credentials. It might be possible to script that too with some code, but I haven’t encountered such a thing yet