- 更新
opkg update - 安装
mosqutto
opkg install mosquitto-nossl libmosquitto-nossl
- 向
/etc/mosquitto/mosquitto.conf末尾插入两行文本
echo -e "allow_anonymous false\npassword_file /etc/mosquitto/pwfile" >> /etc/mosquitto/mosquitto.conf
注释:"-e"表示激活转义字符,"\n"表示换行,"\t"表示Tab键
- 向
/etc/mosquitto/pwfile末尾插入文本
echo "amqtt:mymqtt" >> /etc/mosquitto/pwfile
- 重启
mosqutto服务
/etc/init.d/mosquitto restart
本文详细介绍如何更新并配置Mosquitto MQTT服务,包括安装、设置密码验证、修改配置文件及重启服务等步骤,帮助读者掌握Mosquitto的高级用法。
3101

被折叠的 条评论
为什么被折叠?



