Skip to content

Commit 15dd6db

Browse files
matt-FFFFFFfabaff
authored andcommitted
Add section on Mosquitto ACLs (home-assistant#5542)
* Add section on Mosquitto ACLs * Fix typo
1 parent 061054c commit 15dd6db

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

source/_addons/mosquitto.markdown

+21-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Set up [Mosquitto](https://mosquitto.org/) as MQTT broker.
1818
"ssl": false,
1919
"anonymous": true,
2020
"logins": [
21-
{"username": "testuser", "password": "mypw"}
21+
{"username": "testuser", "password": "mypw"},
22+
{"username": "testuser2", "password": "mypw2"}
2223
],
2324
"customize": {
2425
"active": false,
@@ -76,3 +77,22 @@ protocol mqtt
7677
<p class='note warning'>
7778
It's recommended that you only open your firewall to the SSL/TLS port (8883) and only use the insecure port (1883) for local devices. Also, disable `anonymous:` and set `logins:`.
7879
</p>
80+
81+
### {% linkable_title Access Control Lists (ACLs) %}
82+
83+
It is possible to restrict access to topics based upon the user logged in to Mosquitto. In this scenario it is recommended to create individual users for each of your clients and create an appropriate ACL.
84+
85+
See the following links for more information:
86+
87+
* [Mosquitto topic restrictions](http://www.steves-internet-guide.com/topic-restriction-mosquitto-configuration/)
88+
* [Mosquitto.conf man page](https://mosquitto.org/man/mosquitto-conf-5.html)
89+
90+
Add the following configuration to enable ACLs:
91+
92+
1. Set `customize` flag to `true` in your configuration.
93+
2. Create a file in `/share/mosquitto` named `acl.conf` with the following contents:
94+
95+
```text
96+
acl_file /share/mosquitto/accesscontrollist
97+
```
98+
3. Create a file in `/share/mosquitto` named `accesscontrollist` and add contents according to your requirements.

0 commit comments

Comments
 (0)