16 346
правок
м (→Настройка своего брокера MQTT: Форматирование) |
м (→Настройка своего брокера 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"> |