【问题标题】:Mosquitto MQTT Broker setup with authentication username password带有身份验证用户名密码的 Mosquitto MQTT 代理设置
【发布时间】:2015-12-17 15:43:51
【问题描述】:

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

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

allow_anonymous false

用户名测试 远程用户名测试

remote_password Test123

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

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

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

谢谢, 阿肖克

【问题讨论】:

    标签: mqtt mosquitto


    【解决方案1】:

    remote_usernameremote_password 选项用于配置网桥。您应该查看password_file 选项。例如

    password_file /etc/mosquitto/pwfile
    

    生成文件

    mosquitto_passwd -c /etc/mosquitto/pwfile ashok
    

    并添加更多用户

    mosquitto_passwd /etc/mosquitto/pwfile guest
    

    【讨论】:

    • 有没有办法使用 PHP 或 javascript 以编程方式做同样的事情?
    猜你喜欢
    • 2020-02-15
    • 1970-01-01
    • 1970-01-01
    • 2011-07-04
    • 1970-01-01
    • 2011-03-18
    • 1970-01-01
    • 2016-11-13
    • 1970-01-01
    相关资源
    最近更新 更多