Community discussions

MikroTik App
 
Ilevene
just joined
Topic Author
Posts: 3
Joined: Sun Sep 15, 2013 7:39 pm

How to add entries to SSH ACL

Mon Sep 12, 2016 7:51 pm

Does anyone know how to add an entry to the list of permitted SSH addresses without overwriting the existing list?

I've tried the following script, but all I get is "value of address must have IPv6 address before '/'

/ip service
:global a {[/ip service get ssh address]}
:global b "2.2.2.0/24"
:global c {$a,$b}
:do {/ip service set ssh address=$c}
 
User avatar
Deantwo
Member
Member
Posts: 332
Joined: Tue Sep 30, 2014 4:07 pm

Re: How to add entries to SSH ACL

Tue Sep 13, 2016 11:26 am

To concatenate an element to an array, do this:
:put ({1;2;3} , 5 )
For more information, see: For your specific case, this should do:
/ip service
set ssh address=([get ssh address] , "2.2.2.0/24")
 
Ilevene
just joined
Topic Author
Posts: 3
Joined: Sun Sep 15, 2013 7:39 pm

Re: How to add entries to SSH ACL

Thu Sep 15, 2016 5:08 pm

Thank you very much!