简体   繁体   中英

Mosquitto MQTT Broker setup with authentication username password

I am trying to configure Mosquitto MQTT broker on windows with Authentication with username and password.

I have added below line in mosquitto.conf file:

allow_anonymous false

username Test remote_username Test

remote_password Test123

While running broker following error occurs:

C:\\Program Files (x86)\\mosquitto>mosquitto.exe -c mosquitto.conf -p 1883 Error: Invalid bridge configuration. Error found at mosquitto.conf:750. Error: Unable to open configuration file.

Without username and password I am able to start broker and connect with MQTTLens Client.

Thanks, Ashok

The remote_username and remote_password options are for configuring bridges. You should look at the password_file option. For example

password_file /etc/mosquitto/pwfile

The generate the file with

mosquitto_passwd -c /etc/mosquitto/pwfile ashok

And add more users

mosquitto_passwd /etc/mosquitto/pwfile guest

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM