Page 1 of 1

How to add entries to SSH ACL

Posted: Mon Sep 12, 2016 7:51 pm
by Ilevene
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}

Re: How to add entries to SSH ACL

Posted: Tue Sep 13, 2016 11:26 am
by Deantwo
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")

Re: How to add entries to SSH ACL

Posted: Thu Sep 15, 2016 5:08 pm
by Ilevene
Thank you very much!