Skip to content

Configure password authentication

Edit chart config

Change the chart’s config to disable allow_anonymous by setting authentication to enabled.

values.yaml
auth:
# -- By enabling this, `allow_anonymous` gets set to `false` in the mosquitto config.
# highlight-next-line
enabled: true

Create password and config files

Open the Mosquitto container shell and execute the following commands, one by one, in order:

Terminal window
cd /mosquitto/configinc
mosquitto_passwd -c passwordfile username
echo "password_file /mosquitto/configinc/passwordfile" > passwordconfig.conf