Защита паролем/en: различия между версиями
(Новая страница: «Next step is to close access to the websockets and mqtt control ports from the outside (they are open by default):») |
(Новая страница: «<pre>/etc/mosquitto/conf.d/listeners.conf</pre> file:») |
||
Строка 18: | Строка 18: | ||
Next step is to close access to the websockets and mqtt control ports from the outside (they are open by default): | Next step is to close access to the websockets and mqtt control ports from the outside (they are open by default): | ||
<pre>/etc/mosquitto/conf.d/listeners.conf</pre> file: | |||
меняем содержимое на | меняем содержимое на |
Текущая версия на 00:09, 14 июля 2016
1.
Update the following packages: wb-configs, nginx, mosquitto, wb-mqtt-homeui
apt-get update apt-get install nginx-extras mosquitto wb-configs wb-mqtt-homeui
service mosquitto restart service nginx restart
2.
Next step is to close access to the websockets and mqtt control ports from the outside (they are open by default):
/etc/mosquitto/conf.d/listeners.conf
file:
меняем содержимое на
#change 0.0.0.0 to to limit listener to localhost listener 1883 127.0.0.1 # example: #listener 1883 0.0.0.0 #change 0.0.0.0 to 127.0.0.1 to limit listener to localhost listener 18883 127.0.0.1 protocol websockets
Перезагружаем mosquitto
service mosquitto restart
3.
Идём в веб-интерфейс (не забыть обновить через control+R страничку), Settings, вставляем в Port число 80, нажимаем Apply.
Проверяем, что всё продолжает работать.
4. Активируем глобальную аутентификацию
root@wirenboard:~# ln -s /etc/nginx/sites-available/global_auth /etc/nginx/sites-enabled root@wirenboard:~# service nginx reload
Дефолтный логин-пароль root/wirenboard
5.
Пароль меняется командой
printf "root:`openssl passwd -apr1`\n" > /etc/nginx/passwd
Здесь вместо root можно придумать любое другое имя пользователя