0

I did the following changes in mosquitto.conf

password_file "\etc\mosquitto\passwordfile.txt"
allow_anonymous false

But still when i send the command

mosquitto_pub -u admin -P (wrong password) -m "1" -t "topic"

and

mosquitto_sub -u admin -t "topic"

I am still receiving, at the broker the message I am publishing. Should that be NOT happening?

i created the password file using

mosquitto_passwd -c "etc\mosquitto\passwordfile.txt" admin

I am getting a feeling I am doing a very silly mistake. But just cant put a finger on it

hardillb
  • 54,545
  • 11
  • 67
  • 105
shantanu
  • 11
  • 2
  • Update the question (do not try to add it as a comment) with log output from when mosquitto is started so we see if it's complaining about the config file – hardillb Aug 08 '16 at 08:33
  • Also what OS are you running on? Because you seam to be mixing windows and unix file path separators – hardillb Aug 08 '16 at 08:38
  • What do you mean by "log output from when the mosquitto is started"? I am running Windows OS. I open two terminals and communicate between them using mosquitto_sub and mosquitto_pub commands. – shantanu Aug 08 '16 at 08:53
  • When mosquitto starts it outputs information about what ports it's listening on and information about what password file it's using – hardillb Aug 08 '16 at 08:57
  • How do i find it? I searched in the mosquitto folder. There is no log or .log file present – shantanu Aug 08 '16 at 09:00
  • Looking at the Ubuntu packaged install it looks like they have disabled logging which is not helpful. Look in the mosquitto.conf for the logging section and edit it to something sensible (there are comments to explain). Restart mosquitto and then add the logs – hardillb Aug 08 '16 at 09:16
  • I did that. I changed "log_dest stderr" to "log_dest \etc\mosquitto\log.txt" After restarting the broker and sending multiple Pub Sub messages also, the Log file remains empty. – shantanu Aug 08 '16 at 09:48

0 Answers0