16 Библиотека команд bash команд для Debian11
An-J edited this page 2026-08-01 11:04:38 +03:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Ок. Чисто команды. Без объяснений.


УДАЛИТЬ старый SSH-ключ (Windows / PowerShell)

ssh-keygen -R 192.168.1.101

СКОПИРОВАТЬ файл на edge

scp stage0.sh iomatex@192.168.1.101:/home/iomatex/

СКОПИРОВАТЬ файл на edge под Китайцем

scp .\iomatex-install_r youngfeel@192.168.1.104:/home/youngfeel/iomatex-install

СКОПИРОВАТЬ файл с удаленного сервера на edge

 scp builder@65.109.116.180:/home/builder/itscreen /home/iomatex

Скопировать содержимое файла в clipboard (Ubuntu)

xclip -selection clipboard < stage_itscreen_install.sh

Скопировать содержимое файла в clipboard (PowerShell)

sudo cat stage_itscreen_install.sh | clip.exe
scp -r builder@65.109.116.180:/home/builder/stage_ui /home/iomatex

Переименовать

mv <name> <new_name>

Остановить пиложение

Для desktop режима:

sudo systemctl stop itscreen-x11

Заменить бинарник

Предположим новый файл itscreen лежит в текущей папке:

sudo install -m 0755 -o itscreen -g itscreen itscreen /opt/itscreen/bin/itscreen

Запустить обратно

Для desktop режима:

sudo systemctl restart itscreen-x11

ЗАЙТИ на edge

ssh iomatex@192.168.1.101

ПРОВЕРИТЬ, что файл на edge

ls -lh /home/iomatex/iomatex_zigbee2mqtt_install_v2.sh

ПОСМОТРЕТЬ первые строки файла

head -n 5 /home/iomatex/iomatex_zigbee2mqtt_install_v2.sh

СДЕЛАТЬ исполняемым

chmod +x /home/iomatex/stage1.sh

ЗАПУСТИТЬ

sudo bash /home/iomatex/iomatex_zigbee2mqtt_install_v2.sh

НАЙТИ файл (если потерял)

find /home/iomatex -name 'iomatex_zigbee2mqtt_install_v2.sh'

УДАЛИТЬ файл с edge (если надо)

rm -f /home/iomatex/iomatex_zigbee2mqtt_install_v2.sh

Остановить zigbee2Mqtt:

sudo systemctl stop zigbee2mqtt

Запустить:

sudo systemctl start zigbee2mqtt

Перезапуск:

sudo systemctl restart zigbee2mqtt

Логи в реальном времени:

journalctl -u zigbee2mqtt -f

Отлично. Ниже — чистый, структурированный чек-лист в формате, готовом для Wiki / README (без лишних слов, инженерно).


4. Password file integrity

sudo ls -la /etc/mosquitto/passwd

Ожидаемо:

  • owner: mosquitto
  • group: mosquitto
  • permissions: -rw-r----- (640)

Проверка пользователей:

sudo awk -F: '{print $1}' /etc/mosquitto/passwd

Ожидаемо:

  • пользователь iomatex присутствует

5. Authenticated MQTT test (LOCAL)

Subscribe (terminal 1)

mosquitto_sub -h 127.0.0.1 -t iomatex/test -u iomatex -P iomatex

Publish (terminal 2)

mosquitto_pub -h 127.0.0.1 -t iomatex/test -m hello -u iomatex -P iomatex

Ожидаемо:

  • сообщение hello появляется у subscriber

6. Unauthorized access test (MUST FAIL)

mosquitto_sub -h 127.0.0.1 -t iomatex/test -d

Ожидаемо:

  • Connection Refused: not authorised
  • либо разрыв соединения

7. Bridge configuration (Cloud)

Config file:

/etc/mosquitto/conf.d/10-iomatex.conf

Проверить:

  • connection iomatex_cloud
  • address <host>:<port>
  • remote_username
  • remote_password
  • topic # out 0 ← safe default (no loops)

⚠️ Важно: Пароль cloud-брокера правится только здесь.


8. Logs location

sudo tail -n 50 /var/log/mosquitto/mosquitto.log

Ожидаемо:

  • нет ошибок Duplicate persistence_location
  • нет ошибок Unable to open pwfile
  • нет local only mode warning

9. Health summary (quick check)

systemctl is-active --quiet mosquitto && echo "mosquitto: RUNNING"
ss -lntp | grep -q ':1883' && echo "mqtt: LISTEN 1883"

10. Zigbee2MQTT recommendation

mqtt:
  server: mqtt://127.0.0.1:1883
  user: iomatex
  password: iomatex

Bridge отправляет данные в cloud автоматически.


11. Production health check

echo; echo "=== SYSTEM ERRORS ==="; journalctl -p 3 -b --no-pager | grep -vE 'mpp|rockchip|RKNPU|scmi|spdif|ALSA|Tracker|fiq_debugger|spi-nand' || echo "No critical errors"

Status meaning

Item Meaning
Service running Broker alive
Port 1883 open LAN access enabled
Single persistence_location No startup crash
passwd readable by mosquitto Auth works
Unauthorized test fails Security OK
Bridge out only No loops / duplicates

Result: If all checks pass → Mosquitto is production-ready ✅


12. Посмотреть статус сетей

nmcli device status