Community discussions

 
Redmor
Member Candidate
Member Candidate
Topic Author
Posts: 233
Joined: Wed May 31, 2017 7:40 pm
Location: Italy

MAC Telnet in scripts

Thu Feb 07, 2019 9:57 pm

I would like to MAC Telnet in scripts, don't you?
ImageImage
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1164
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: MAC Telnet in scripts

Thu Feb 07, 2019 10:19 pm

with private + public keys installed, what's the difference with ssh?
 
Redmor
Member Candidate
Member Candidate
Topic Author
Posts: 233
Joined: Wed May 31, 2017 7:40 pm
Location: Italy

Re: MAC Telnet in scripts

Fri Feb 08, 2019 8:13 am

Can you SSH with scripts or API? I've tried without success.
ImageImage
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1164
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: MAC Telnet in scripts

Fri Feb 08, 2019 9:57 am

That's a good question...

So tried, and you can.

* Created keys (pub + priv): see https://wiki.mikrotik.com/wiki/Use_SSH_ ... figuration
* imported pub in target system: see previous link
* imported pub+priv in source system: see https://wiki.mikrotik.com/wiki/Manual:S ... ertificate
* 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] >
 
Redmor
Member Candidate
Member Candidate
Topic Author
Posts: 233
Joined: Wed May 31, 2017 7:40 pm
Location: Italy

Re: MAC Telnet in scripts

Fri Feb 08, 2019 7:57 pm

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
ImageImage
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1164
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: MAC Telnet in scripts

Fri Feb 08, 2019 8:19 pm

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

Who is online

Users browsing this forum: No registered users and 6 guests