# urbestack-jail-set

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-jail-set --name NAME [--enabled on|off] [--log PATH] [--pattern REGEX] [--tries N] [--window TIME] [--bantime TIME] [--scope all|mail|web]
```

## Description

Updates an existing ban rule. Specify at least one setting to change. Use --enabled to switch the rule on or off. Set --scope to all for all ports, mail for mail ports or web for web ports.

--tries sets how many matches for an IP address within --window trigger a ban. --tries accepts 1 to 1000, --window accepts 10 seconds to 30 days, and --bantime accepts 10 seconds to 366 days. Enter durations in whole seconds or with a unit, as in 10s, 10m, 1h, 2d or 1w.

Only custom rules accept --log and --pattern. Give --log the absolute path to an existing log file. Give --pattern a single-line regular expression of up to 500 characters, with <HOST> where the IP address appears.

## Same in the API

- [PATCH /security/jails/{name}](https://urbestack.com/docs/api/patch-security-jails-name.md): Update a ban rule

## Command family: jail

- [urbestack-jail-add](https://urbestack.com/docs/commands/urbestack-jail-add.md): Adds a custom ban rule.
- [urbestack-jail-del](https://urbestack.com/docs/commands/urbestack-jail-del.md): Removes a custom ban rule.
- [urbestack-jail-list](https://urbestack.com/docs/commands/urbestack-jail-list.md): Lists the ban rules shipped with UrbeStack, followed by custom rules in name order.
- [urbestack-jail-test](https://urbestack.com/docs/commands/urbestack-jail-test.md): Tests a ban rule or a regular expression against up to 1,000 of the most recent lines from a log file or systemd journal.
