I shortened my configuration file to only the areas I had uncommented for use with configuring the broker.
Here is my (1) sub/pub statements, (2) config file, (3) my acls file, (4) example password file, and (5) my logs.
(1) sub/pub statements
mosquitto_sub -h 192.168.1.106 -u roger -P xyzexampleâ -t MQBT1
mosquitto_pub -h 192.168.1.115 -u roger -P xyzexampleâ -t MQBT1 -m âhelloâ
(2) Mosquito.conf
Config file for mosquitto
See mosquitto.conf(5) for more information.
Default values are shown, uncomment to change.
Use the # character to indicate a comment, but only if it is the
very first character on the line.
==============================================
General configuration
==============================================
LISTENERS
==============================================
On systems that support Unix Domain Sockets, it is also possible
to create a # Unix socket rather than opening a TCP socket. In
this case, the port number should be set to 0 and a unix socket
path must be provided, e.g.
listener 0 /tmp/mosquitto.sock
listener port-number [ip address/host name/unix socket path]
listener 1883
==============================================
Logging
==============================================
Places to log to. Use multiple log_dest lines for multiple
logging destinations.
If set to true, client connection and disconnection messages will be included
in the log.
connection_messages true
log_timestamp true
Set the format of the log timestamp. If left unset, this is the number of
seconds since the Unix epoch.
This is a free text string which will be passed to the strftime function. To
get an ISO 8601 datetime, for example:
log_timestamp_format %Y-%m-%dT%H:%M:%S
===========================================
Security
===========================================
If set, only clients that have a matching prefix on their
clientid will be allowed to connect to the broker. By default,
all clients may connect.
For example, setting âsecure-â here would mean a client âsecure-
clientâ could connect but another with clientid âmqttâ couldnât.
allow_anonymous false
===========================================
Default authentication and topic access control
===========================================
Control access to the broker using a password file. This file can be
generated using the mosquitto_passwd utility.
password_file /etc/mosquitto/passwordfile_example.txt
acl_file /etc/mosquitto/acls.txt
(3) acls file
topic readwrite MQBT1
user rei
(4) password file
roger:$6$clQ4Ocu312S0qWgl$Cv2wUxgEN73c6C6jlBkswqR4AkHsvDLWvtEXZZ8NpsBLgP1WAo/qA+WXcmEN/mjDNgdUwcxRAveqNMs2xUVQYA==
(5) Log file
2024-03-11T08:04:07: mosquitto version 2.0.11 starting
2024-03-11T08:04:07: Config loaded from /etc/mosquitto/mosquitto.conf.
2024-03-11T08:04:07: Opening ipv4 listen socket on port 1883.
2024-03-11T08:04:07: Opening ipv6 listen socket on port 1883.
2024-03-11T08:04:07: mosquitto version 2.0.11 running
2024-03-11T08:12:19: New connection from 192.168.1.106:42466 on port 1883.
2024-03-11T08:12:19: New client connected from 192.168.1.106:42466 as auto-765394D0-A846-9ACA-02F6-2E21DD6EF22B (p2, c1, k60, uâreiâ).
2024-03-11T08:12:19: Client auto-765394D0-A846-9ACA-02F6-2E21DD6EF22B disconnected.