I've been trying to find a way to disconnect active SSH or Winbox/Dude session to a router. For example, I deployed a MikroTik router and by accident left admin password as default (which is no password), then I logged in to a device and realized there's unknown SSH connection (unauthorized of course). To fix it I would change the password and disconnect existing SSH connection(s), but how?
I couldn't find a command to kick SSH or Winbox/Dude user.
Then I tried to terminate a connection using "/ip firewall connection remove ..." command, but it won't do anything with established TCP session. In particular I tried the following:
Code: Select all
/ip firewall connection remove [/ip firewall connection find]
OR to be more specific and disconnect only Winbox/Dude connections (TCP/8291):
Code: Select all
/ip firewall connection { remove [find where protocol=tcp and dst-address~":8291"] }
Then I tried to disable Winbox service on a router, but it won't turn down the existing Winbox connection(s).
Code: Select all
/ip service set winbox disabled=yes
Looks like I'm missing something. It has to be a way to turn down existing TCP connection by command without rebooting the whole device. Please help.