4

I have set the acl_file property in /etc/mosquitto/mosquitto.conf to /home/ubuntu/my.acl. In the ACL file, I have allow_anonymous false to disallow connections from clients that do not have user name.

From MQTT Lens, I tried connecting to this broker without passing user name. I don't see a connect message immediately in the log. However, when I delete the connection from MQTT Lens, I see the message as connected followed by a disconnect message.

ubuntu@ip-172-31-42-207:/var/log/mosquitto$ tail -f mosquitto.log  
1527666604: New connection from 183.xx.xx.xx on port 1883.
1527666604: New client connected from 183.xx.xx.xx as lens_bWIkzTxFSc2BIIUQqqT35ipsiPV (c1, k120).
1527666746: Client lens_bWIkzTxFSc2BIIUQqqT35ipsiPV disconnected.

How can I confirm that allow_anonymous false actually denied the connection?

3

allow_anonymous false needs to be in the mosquitto.conf file not the acl file

IIRC the logging is delayed because of a minor bug in some versions of mosquitto because you are not driving any other load through the broker

  • :facepalm: I misread the man mosquitto.conf page! – cogitoergosum May 30 '18 at 8:10
  • Great answer, though I'm not sure I like allow_anonymous false. Grrr! ;) – anonymous2 Jun 1 '18 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.