MQTT Mosquitto Broker: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| (2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 4: | Zeile 4: | ||
*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 | ||
| − | ==Verschlüsselt mit Passwort und Client Identifikation== | + | == Unverschlüsselt mit Passwort == |
| − | listener 8883 0.0.0.0 | + | listener 1883 0.0.0.0 |
| − | allow_anonymous false | + | allow_anonymous false |
| − | log_type all | + | log_type all |
| − | connection_messages true | + | connection_messages true |
| − | password_file /etc/mosquitto/passwd | + | password_file /etc/mosquitto/passwd |
| − | + | ||
| − | cafile /etc/mosquitto/conf.d/ca.crt | + | == Verschlüsselt mit Passwort == |
| − | keyfile /etc/mosquitto/conf.d/FQDN.key | + | listener 8883 0.0.0.0 |
| − | require_certificate true | + | allow_anonymous false |
| − | use_identity_as_username true | + | 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