MQTT Mosquitto Broker: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „= Installiere den Broker = *apt update && apt-get upgrade *apt install mosquitto *apt install mosquitto-clients“)
 
 
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 3: Zeile 3:
 
*apt install mosquitto
 
*apt install mosquitto
 
*apt install mosquitto-clients
 
*apt install mosquitto-clients
 +
 +
= Handling =
 +
*systemctl start mosquitto.service
 +
*systemctl restart mosquitto.service
 +
*systemctl stop mosquitto.service
 +
*systemctl status mosquitto.service
 +
*journalctl -fu mosquitto.service
 +
 +
= Die Konfiguration erfolgt in der Datei '''/etc/mosquitto/conf.d/defaults.conf''' =
 +
 +
== Unsicher ohne Passwort ==
 +
listener 1883 0.0.0.0
 +
allow_anonymous true
 +
log_type all
 +
connection_messages true
 +
 +
== Unverschlüsselt mit Passwort ==
 +
listener 1883 0.0.0.0
 +
allow_anonymous false
 +
log_type all
 +
connection_messages true
 +
password_file /etc/mosquitto/passwd
 +
 +
== Verschlüsselt mit Passwort ==
 +
listener 8883 0.0.0.0
 +
allow_anonymous false
 +
log_type all
 +
connection_messages true
 +
password_file /etc/mosquitto/passwd
 +
certfile /etc/mosquitto/conf.d/FQDN.crt
 +
cafile  /etc/mosquitto/conf.d/ca.crt
 +
keyfile  /etc/mosquitto/conf.d/FQDN.key
 +
 +
== Verschlüsselt mit Passwort und Client Identifikation ==
 +
listener 8883 0.0.0.0
 +
allow_anonymous false
 +
log_type all
 +
connection_messages true
 +
password_file /etc/mosquitto/passwd
 +
certfile /etc/mosquitto/conf.d/FQDN.crt
 +
cafile  /etc/mosquitto/conf.d/ca.crt
 +
keyfile  /etc/mosquitto/conf.d/FQDN.key
 +
require_certificate true
 +
use_identity_as_username true

Aktuelle Version vom 20. Juni 2026, 06:57 Uhr

Installiere den Broker

  • apt update && apt-get upgrade
  • apt install mosquitto
  • apt install mosquitto-clients

Handling

  • systemctl start mosquitto.service
  • systemctl restart mosquitto.service
  • systemctl stop mosquitto.service
  • systemctl status mosquitto.service
  • journalctl -fu mosquitto.service

Die Konfiguration erfolgt in der Datei /etc/mosquitto/conf.d/defaults.conf

Unsicher ohne Passwort

listener 1883 0.0.0.0
allow_anonymous true
log_type all
connection_messages true

Unverschlüsselt mit Passwort

listener 1883 0.0.0.0
allow_anonymous false
log_type all
connection_messages true
password_file /etc/mosquitto/passwd

Verschlüsselt mit Passwort

listener 8883 0.0.0.0
allow_anonymous false
log_type all
connection_messages true
password_file /etc/mosquitto/passwd
certfile /etc/mosquitto/conf.d/FQDN.crt
cafile  /etc/mosquitto/conf.d/ca.crt
keyfile  /etc/mosquitto/conf.d/FQDN.key

Verschlüsselt mit Passwort und Client Identifikation

listener 8883 0.0.0.0
allow_anonymous false
log_type all
connection_messages true
password_file /etc/mosquitto/passwd
certfile /etc/mosquitto/conf.d/FQDN.crt
cafile  /etc/mosquitto/conf.d/ca.crt
keyfile  /etc/mosquitto/conf.d/FQDN.key
require_certificate true
use_identity_as_username true