Перейти к содержанию

Навигация

MQTT: различия между версиями

м
Строка 354: Строка 354:
apt update && apt install mosquitto mosquitto-clients -y
apt update && apt install mosquitto mosquitto-clients -y
</syntaxhighlight>
</syntaxhighlight>
#Отредактируйте файл конфигурации
#Отключите возможность анонимного входа, для этого:
#*Откройте файл конфигурации в редакторе
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">
nano /etc/mosquitto/mosquitto.conf
nano /etc/mosquitto/mosquitto.conf
</syntaxhighlight>
</syntaxhighlight>
#И отключите возможность анонимного входа, добавив строки:
#*Добавьте строки:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">
#Disable anonomous login:
#Disable anonomous login:
Строка 369: Строка 370:
mosquitto_passwd -c /etc/mosquitto/mosquitto.pwd test
mosquitto_passwd -c /etc/mosquitto/mosquitto.pwd test
</syntaxhighlight>
</syntaxhighlight>
#Введите дважды пароль и запомните его, он вам пригодится ниже.
#Введите пароль дважды и запомните его, он вам пригодится ниже.
#Перезапустите <code>mosquitto</code> и проверьте его состояние:
#Перезапустите <code>mosquitto</code> и проверьте его состояние:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">