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?

cogitoergosum
  • 1,091
  • 7
  • 18

1 Answers1

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

hardillb
  • 12,813
  • 1
  • 21
  • 34