Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » Connection Refused: not authorised only at mosquitto_pub (mqtt in docker)(mqtt.fx,Homeassistant etc. works fine with my mqtt brocker but mosquitto_pub in commandline thows not authorised)
Connection Refused: not authorised only at mosquitto_pub (mqtt in docker) [message #1839729] Fri, 26 March 2021 14:46 Go to next message
Sascha N is currently offline Sascha NFriend
Messages: 3
Registered: March 2021
Junior Member
Im using my mqtt brocker for one year in an docker.
Recently I updated my whole rapsi and all dockers etc.
Up to that point everything worked

If I use mqtt.fx from my PC or my also in docker running Homeassistant to publish an message everthing works in both direction but if I want to publish a message via mosquitto_pub in the command line via ssh (or directly at the raspi) I get Connection Refused: not authorised.

The mqtt docker uses port 1883
Im using the correct username and password
I tried several addiotional parameters -h localhost -p 1883
BTW: The mqtt docker has another ip adress (172.18.0.2) then my rapsi itself (192.168.178.X). At the mqtt Docker a Gateway 172.18.0.1 is set. Does the -h parameter needs the docker ip or the main ip?

mosquitto_pub -p 1883 -h localhost -u myuser -P mypw -t /Test -m "TEST-MSG"
Connection Refused: not authorised.
Error: The connection was refused.

mqtt logfile: 1616766878: New connection from 172.18.0.1:33986 on port 1883.
1616766878: Client <unknown> disconnected, not authorised.
==> look like it comes from the Gateway IP

I assume its something related to my mosquitto.conf or something with the iptables

Thanks for your help.


mosquitto.conf:
persistence false
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
password_file /mosquitto/config/pwfile
allow_anonymous false
log_timestamp true
log_type error
log_type warning
log_type notice
log_type information
listener 1883

[Updated on: Sat, 27 March 2021 10:47]

Report message to a moderator

Re: Connection Refused: not authorised only at mosquitto_pub (mqtt in docker) [message #1839778 is a reply to message #1839729] Sun, 28 March 2021 13:48 Go to previous messageGo to next message
Sascha N is currently offline Sascha NFriend
Messages: 3
Registered: March 2021
Junior Member
any ideas what to do?
Re: Connection Refused: not authorised only at mosquitto_pub (mqtt in docker) [message #1839981 is a reply to message #1839778] Fri, 02 April 2021 17:08 Go to previous message
Sascha N is currently offline Sascha NFriend
Messages: 3
Registered: March 2021
Junior Member
Do you need more information or is there noone whoo can help me?
Previous Topic:Install Mosquitto v2 in Raspberry Pi?
Next Topic:Multiple Publishes i
Goto Forum:
  


Current Time: Thu May 02 21:45:34 GMT 2024

Powered by FUDForum. Page generated in 0.03390 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top