43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
= Berechtigungen
|
|
|
|
Verwenden Sie `mosquitto_sub` mit dem Host `test.mosquitto.org`, MQTT 5,
|
|
Port `1884`, Usernamen "ro" und Passwort (`-P`) "readonly"
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_sub --host test.mosquitto.org --port 1884 -V 5 --qos 1 --topic "demotopic" \
|
|
--username ro -P readonly -W 2 --debug
|
|
|
|
|
|
Was passiert, wenn Sie "wo" und Passwort "writeonly" nutzen?
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_sub --host test.mosquitto.org --port 1884 -V 5 --qos 1 --topic "demotopic" \
|
|
--username wo -P writeonly -W 2 --debug
|
|
|
|
|
|
Was passiert, wenn Sie mit den 'ro' User etwas publishen wollen?
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_pub --host test.mosquitto.org --port 1884 -V 5 --qos 1 --topic "demotopic" \
|
|
--username ro -P readonly --message "demo message" --debug
|
|
|
|
|
|
|
|
|
|
|
|
Alternativ kann mittels `docker compose up` gleichartiges lokales Setup verwendet werden:
|
|
|
|
$ docker compose up
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_sub -V 5 --qos 1 --topic "demotopic" \
|
|
--username ro -P readonly -W 2 --debug
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_sub -V 5 --qos 1 --topic "demotopic" \
|
|
--username wo -P writeonly -W 2 --debug
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_pub -V 5 --qos 1 --topic "demotopic" \
|
|
--username ro -P readonly --message "demo message" --debug
|