Categorie
Non categorizzato

mosquitto install on ubuntu

sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients

 

sudo /etc/init.d/mosquitto start

 

reference:

Install Mosquitto MQTT Broker on Ubuntu 16.04 LTS (Xenial Xerus)

config: /etc/mosquitto/mosquitto.conf


sudo gedit /etc/mosquitto/mosquitto.conf

add on mosquitto.conf file:
allow_anonymous false

add user:
generate the pw file with:

sudo mosquitto_passwd -c /etc/mosquitto/pwfile username

add more users

sudo mosquitto_passwd /etc/mosquitto/pwfile guest

reference:
http://mosquitto.org/man/mosquitto-conf-5.html
https://mosquitto.org/man/mosquitto_passwd-1.html

 

activate SSL

reference:

MQTT Mosquitto broker with SSL/TLS transport security
http://rockingdlabs.dunmire.org/exercises-experiments/ssl-client-certs-to-secure-mqtt
https://mosquitto.org/man/mosquitto-tls-7.html