mosquitto_ctrl 1 Mosquitto Project Commands
mosquitto_ctrl a tool for initialising/configuring a Mosquitto broker instance
`mosquitto_ctrl` options | `-o` config-file module-name module-command command-options `options:` auth-options connection-options mqtt-options output-options tls-certificate-options tls-psk-options `auth-options:`
`-u` username `-P` password `connection-options:`
`-h` hostname `--unix` socket path `-p` port-number `-L` URL
`-A` bind-address
`--proxy` socks-url `mqtt-options:`
`-c` `-i` client-id `-q` message-QoS `-V` protocol-version `output-options:`
`-d` `--quiet` `mosquitto_ctrl` connection-options (interactive shell mode) `mosquitto_ctrl` `--help`

## Description

`mosquitto_ctrl` is a tool for helping configure a Mosquitto broker instance.

It can be run primarily as a straightforward command line tool, as described here, or as an interactive shell as described in mosquitto_ctrl_shell 1 . The interactive shell makes most operations very straightforward and is recommended for ease of use.

## Encrypted Connections

`mosquitto_ctrl` supports TLS encrypted connections. It is strongly recommended that you use an encrypted connection for all remote use of mosquitto_ctrl.

To enable TLS connections when using x509 certificates, one of either `--cafile` or `--capath` must be provided as an option.

To enable TLS connections when using TLS-PSK, you must use the `--psk` and the `--psk-identity` options.

## Modules

`Dynamic security`

  Authentication, and role based access control with users and groups. Uses the `dynsec` module name. See: mosquitto_ctrl_dynsec 1

`External modules`

  `mosquitto_ctrl` has the ability to load external modules in the form of shared libraries. For example using the module name `example` will try to load the external module `mosquitto_ctrl_example.so` or `mosquitto_ctrl_example.dll`, depending on platform. This allows new functionality to be added to Mosquitto by combining a plugin and mosquitto_ctrl module, without having to recompile any Mosquitto source code.

## Connection Options

The options below may be given on the command line, but may also be placed in a config file located at `$XDG_CONFIG_HOME/mosquitto_ctrl` or `$HOME/.config/mosquitto_ctrl`.

The config file may be specified manually with the `-o config-file` option.

The config file should have one pair of `-option value` per line. The values in the config file will be used as defaults and can be overridden by using the command line. The exceptions to this are the message type options, of which only one can be specified. Note also that currently some options cannot be negated, e.g. `-S`. Config file lines that have a `#` as the first character are treated as comments and not processed any further.

`-o` config-file

  Provide a path to a config file to load options from. The config file should have one pair of `-option value` per line. The values in the config file will be used as defaults and can be overridden by using the command line. The exceptions to this are the message type options, of which only one can be specified. Note also that currently some options cannot be negated, e.g. `-S`. Config file lines that have a `#` as the first character are treated as comments and not processed any further.

`-q`
`--qos`

  Specify the quality of service to use for messages, from 0, 1 and 2. Defaults to 1.

`--unix`

  Connect to a broker through a local unix domain socket instead of a TCP socket. This is a replacement for `-h` and `-L`. For example: `mosquitto_ctrl --unix /tmp/mosquitto.sock ...`

  See the `socket_domain` option in mosquitto.conf 5 to configure Mosquitto to listen on a unix socket.

## Properties

The `-D` / `--property` option allows adding properties to different stages of the mosquitto_ctrl run. The properties supported for each command are as follows:

## Environment Variables

## See Also

- mosquitto 7
- mqtt 7
- mosquitto_ctrl_shell 1
- mosquitto_rr 1
- mosquitto_pub 1
- mosquitto_sub 1
- mosquitto 8
- libmosquitto 3
- mosquitto-tls 7

## Author

Roger Light roger@atchoo.org