Problem with new created user for MQTT

I’m new to Home Assistant. I’ve installed HassOS and Mosquitto add-on. I’ve created a new user ‘mqttuser’ (in Configuration → Users). The ‘mqttuser’ user can log into web interface. However, when I try to use ‘mqttuser’ for mqtt autentification, it fails. If I use the default user (created when I installed the system) for mqtt, it works fine. I have nothing in the ‘logins:’ section of the mosquitto add-on configuration. I’ve restarted several times the system.
Any ideas?.

How does it fail? Please include full error logs. What does your ACL file look like?

here is mine

and the log

That’s your configuration file. For ACLs you’d have a /share/mosquitto/acl.conf which would refer to another file in /share/mosquitto/ with the actual ACLs.

I don’t think this is strictly necessary because in order to specify ACL configuration files you also have to set true, and it’s false by default, but the docs don’t have the ACL section labelled as optional (could be an oversight) so I’d recommend implementing the steps in the ACL section of the docs.

It’s better to restrict what topics a user can pub/sub to anyway. Here’s a sampling of my ACL files. I have a hass user that homeassistant uses, and a shelly user that my Shelly/Tasmota devices use.


acl_file /share/mosquitto/accesscontrollist


user hass
topic read $SYS/#
topic readwrite #
topic readwrite homeassistant/#
topic readwrite shellies/#
topic readwrite wled/#

user shelly
topic readwrite shellies/#
topic readwrite cmnd/#
topic readwrite stat/#
topic readwrite tele/#
topic readwrite tasmota/#

# This affects all clients.
pattern write $SYS/broker/connection/%c/state
pattern write owntracks/%u/#
pattern write %u/#