Advertisement
Javi

Mosquitto: basic websocket conf

Aug 27th, 2020 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. # https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-ubuntu-18-04-quickstart
  2. # https://medium.com/jungletronics/mosquitto-acls-ac062aea3f9
  3. # https://jaimyn.com.au/mqtt-use-acls-multiple-user-accounts/
  4. # https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-ubuntu-18-04-quickstart
  5.  
  6. # Creating passwd file: sudo mosquitto_passwd -c /etc/mosquitto/passwd username
  7. # Adding new user: sudo mosquitto_passwd /etc/mosquitto/passwd username
  8.  
  9. cat << 'EOF' >> /etc/mosquitto/mosquitto.acl
  10. user wordsharing
  11. topic readwrite wordsharing/#
  12.  
  13. user ciberado
  14. topic readwrite #
  15. EOF
  16.  
  17. cat << 'EOF' >> /etc/mosquitto/conf.d/tls.conf
  18. allow_anonymous false
  19. password_file /etc/mosquitto/passwd
  20. acl_file /etc/mosquitto/mosquitto.acl
  21.  
  22. listener 1883 localhost
  23.  
  24. listener 8883
  25. certfile /etc/letsencrypt/live/mqtt.aprender.cloud/cert.pem
  26. cafile /etc/letsencrypt/live/mqtt.aprender.cloud/chain.pem
  27. keyfile /etc/letsencrypt/live/mqtt.aprender.cloud/privkey.pem
  28.  
  29. listener 8083
  30. protocol websockets
  31. certfile /etc/letsencrypt/live/mqtt.aprender.cloud/cert.pem
  32. cafile /etc/letsencrypt/live/mqtt.aprender.cloud/chain.pem
  33. keyfile /etc/letsencrypt/live/mqtt.aprender.cloud/privkey.pem
  34. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement