I did manage manipulate configuration like:
…
while read line
do
ip=expr $ip + 1 ;
ssh www-dev@192.168.15.254 “/ppp secret add name=$username local-address=192.168.3.1 remote-address=192.168.3.$ip profile=default-encryption service=pptp password=$password” < /dev/null
&& sleep 1
&& echo “$username added”
done
" < /dev/null" part is necessary (found on forum). Because in such loops without it. It executes only first command and eats all others commands in loop.
About a script / way of scripting i know it is not the coolest way but at least works and i am capable of doing such things:).
Basically what current script does - it connects over ssh using imported private key. first part not mentioned here just deletes all ppp profiles counting from 100 to 0. And then based on some file it adds all user names and passwords. one by one.
And the weird part is that script can work once on twice and everything is fine. But then somehow/something crashes on RouterOS and i can’t get prompt anymore. And i can authenticate. But cannot get shell prompt. (when you mistype password it asks again). But when password/privatekey is correct it with a delay about 30 sec. Prints Mikrotik ASCII banner. But nothing more.
I still can access mikrotik over winbox and modify configuration over winbox. Also packet processing goes ok. But as i mentioned i cannot access mikrotik over ssh/telnet. And i also cannot get terminal from winbox. It acts the same way (some timeout then prints ASCII art and nothing more).
I was trying to enable/disable ssh terminal service. Login as different user. etc.
Hardware load is below 10% (RAM/CPU). I have two different RB1100 AHx2. And on both same symptoms. As i said. The script goes ok once maybe even 5 times. But then i get this lockout.
RouterOS 5.18.
Forgot to say that after reboot everything works again. But that is not the solution…


