Mosquitto Listen-Port auf 0.0.0.0 einstellen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

Mosquitto Listen-Port und Passwortauthentifizierung konfigurieren

Passwort für Mosquitto setzen

1. Erstelle ein Passwort für den Benutzer:

  • sudo mosquitto_passwd -c /etc/mosquitto/passwd meinuser

Öffne die Mosquitto-Konfigurationsdatei

  • sudo nano /etc/mosquitto/conf.d/default.conf

Füge folgende Konfigurationszeilen hinzu

listener 1883 0.0.0.0
password_file /etc/mosquitto/passwd
allow_anonymous false

Starte Mosquitto neu

  • sudo systemctl restart mosquitto

Überprüfe, ob Mosquitto auf allen Schnittstellen lauscht

  • sudo netstat -tulnp | grep mosquitto