我用mosquitto_passwd
命令创建了一个密码文件.
mosquitto_passwd /etc/mosquitto/passwd admin
Run Code Online (Sandbox Code Playgroud)
我在以下位置添加了密码文件的路径mosquitto.conf
:
password_file /etc/mosquitto/passwd
Run Code Online (Sandbox Code Playgroud)
但是当我订阅或发布它不需要用户名/密码?
mosquitto_sub -t '#' -d
Client mosqsub/19032-Dell sending CONNECT
Client mosqsub/19032-Dell received CONNACK
Client mosqsub/19032-Dell sending SUBSCRIBE (Mid: 1, Topic: #, QoS: 0)
Client mosqsub/19032-Dell received SUBACK
Subscribed (mid: 1): 0
Run Code Online (Sandbox Code Playgroud)
我错过了什么?