translator, wb_editors
4444
правки
Matveevrj (обсуждение | вклад) Метка: отменено |
Matveevrj (обсуждение | вклад) (Отмена правки 73440, сделанной Matveevrj (обсуждение)) Метка: отмена |
||
Строка 404: | Строка 404: | ||
sudo apt update && sudo apt install mosquitto mosquitto-clients -y | sudo apt update && sudo apt install mosquitto mosquitto-clients -y | ||
</syntaxhighlight> | </syntaxhighlight> | ||
#Отключите возможность анонимного входа, для этого в | #Отключите возможность анонимного входа, для этого: | ||
#*Откройте файл конфигурации в редакторе | |||
#:<syntaxhighlight lang="bash"> | #:<syntaxhighlight lang="bash"> | ||
nano /etc/mosquitto/conf | sudo nano /etc/mosquitto/mosquitto.conf | ||
</syntaxhighlight> | |||
#*Добавьте в конец файла строки: | |||
#:<syntaxhighlight lang="bash"> | |||
#Turn on port listening | |||
listener 1883 | |||
#Disable anonomous login: | |||
allow_anonymous false | |||
#Password file: | |||
password_file /etc/mosquitto/mosquitto.pwd | |||
</syntaxhighlight> | </syntaxhighlight> | ||
#Создайте пароль для пользователя, в примере использован пользователь <code>test</code> с паролем <code>wbpassword</code>: | #Создайте пароль для пользователя, в примере использован пользователь <code>test</code> с паролем <code>wbpassword</code>: | ||
Строка 412: | Строка 422: | ||
sudo mosquitto_passwd -c /etc/mosquitto/mosquitto.pwd test | sudo mosquitto_passwd -c /etc/mosquitto/mosquitto.pwd test | ||
</syntaxhighlight> | </syntaxhighlight> | ||
#Введите пароль дважды и запомните его | #Введите пароль дважды и запомните его, он вам пригодится ниже. | ||
#Перезапустите <code>mosquitto</code> и проверьте его состояние: | #Перезапустите <code>mosquitto</code> и проверьте его состояние: | ||
#:<syntaxhighlight lang="bash"> | #:<syntaxhighlight lang="bash"> |