Skip to content

Command filters

Block or log dangerous commands typed in SSH and Telnet sessions.

Who can do this: the Manager, people with Total on Remote Access, or a Remote Access manager.

  1. Open Regras de acesso (Access rules) and the Filtros de comandos (Command filters) tab.

    Command filters tab

  2. Click Novo filtro (New filter) and fill in Nome (Name, e.g. Comandos perigosos).

  3. Under Regras (Rules), write one rule per line:

    bloquear: system reset
    bloquear re: ^/?system (reboot|shutdown)
    avisar: /user add
    • bloquear: texto (block) blocks any command that contains the text, case-insensitive.
    • avisar: texto (warn) lets the command through and logs it.
    • re after the action switches to a regular expression.

    Novo filtro de comandos dialog

  4. Check Pessoas (People; none checked means everyone), Grupos (Groups; none checked means all) and Protocolos (Protocols: SSH and Telnet).

  5. Leave Ligado (On) checked and click Salvar (Save).

The panel checks each command when you press Enter. If a command is blocked, it never reaches the device and the session shows “Comando bloqueado pelo filtro” (Command blocked by filter) with the filter name. With a warning, the session shows “Aviso do filtro (nome): o comando ficou registrado.” (Filter warning (name): the command was logged.) Both cases go to the audit log. A filter that is off shows as Desligado (Off) in the list.

Filters apply to SSH and Telnet. WinBox and RDP sessions do not go through them. If you delete a filter, new sessions are no longer checked against it.

  • “Linha N: comece com “bloquear:” ou “avisar:” (e “re” para expressão).“ (Line N: start with “bloquear:” or “avisar:”, and “re” for an expression.) Fix the start of that line.
  • “Linha editada com setas ou Tab: com filtro de comandos, digite o comando inteiro.” (Line edited with arrows or Tab: with a command filter, type the whole command.) Type the full command without using Tab or the arrow keys to edit it.