使用身份验证用户名密码设置 Mosquitto MQTT 代理

Ash*_*hok 0 mqtt mosquitto

我正在尝试在 Windows 上配置 Mosquitto MQTT 代理,并使用用户名和密码进行身份验证。

我在 mosquitto.conf 文件中添加了以下行:

允许匿名假

用户名测试remote_username测试

远程密码测试123

运行代理时出现以下错误:

C:\Program Files (x86)\mosquitto>mosquitto.exe -c mosquitto.conf -p 1883 错误:桥接配置无效。在 mosquitto.conf 发现错误:750。错误:无法打开配置文件。

无需用户名和密码,我就可以启动代理并与 MQTTLens 客户端连接。

谢谢,阿肖克

ral*_*ght 5

remote_username选项remote_password用于配置网桥。你应该看看这个password_file选项。例如

password_file /etc/mosquitto/pwfile
Run Code Online (Sandbox Code Playgroud)

生成文件

mosquitto_passwd -c /etc/mosquitto/pwfile ashok
Run Code Online (Sandbox Code Playgroud)

并添加更多用户

mosquitto_passwd /etc/mosquitto/pwfile guest
Run Code Online (Sandbox Code Playgroud)