Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Authentication failure
  • From: Anthony Falzon III <falzon03@xxxxxxx>
  • Date: Sun, 25 Aug 2024 19:40:33 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3NFC3ouDcOmX3rq+pL679EqoruxaUAOv7N9i69YcLw0=; b=qK5A5pM+7QFBu585uEUibSBOP5GB8/HRIdl/Gl/KMAN3J4bpfum8vicc7iY05QkDlY6MC3MnEmkHYWFk/VsVXLxhifWPpl5/q4AI0jB5Bwt7gSTMyYuGmoa+xYJUfdORVGKT0sa2IqIRb5TV0LkKZY4X3Dl8+GmQSl04HvqbydsMEVJa5Bh66RMGfhvMYAqgSIablEcxCC/xLQUTT344Sc6nS0/MxUD2QvLyjzoW9qbDGeUgphGbmqkLiB7V8Ed/TsUwLSun0v4+39FcJiWbbc1W3ixjPGr9uEO1S9pE+DyKDSB7yAKrzClJTZO7tZWyrmxGVQvtcimiaIl1F3xhvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EmGo10CwghZCOUcpookLGH/BQqtLw8Ptyzhd4icbFvx2ePMUGc+f5z4Ow4CpIn+B15kdhNLj4OCuZM++zXDHbYlkRAQiQ+VKEKv2v579XZYZvohjrwEqUGOD+YyZH/VXLyc9Oax6Sr78p55UL8CBglgbpkOlQ3H2Uxsti9LmQmaKby7Wotqz/rtpEy6H7Qqo2tviNtKMssDHVWIQiTpI7Wuhi27gdvTE1szE6Wm6V1xLWGLgB8bQlJ2U18AGmpVK+fCrpV8ic0cg4niyKjS3XZT5KEuvUyzVIJyVcohpUiVuRQ0hUOy49q+u8Fa31aB3NSuQQLlSFREZVhsDxFHpMg==
  • Delivered-to: mosquitto-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/mosquitto-dev/>
  • List-help: <mailto:mosquitto-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/mosquitto-dev>, <mailto:mosquitto-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/mosquitto-dev>, <mailto:mosquitto-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHa9cytH7UPlwDz9k2v2YQ2qFQQlbI2A2iAgAFNFSiAAFJTgIAAvTLI
  • Thread-topic: [mosquitto-dev] Authentication failure

I first tried it with the generated password, that didn't work which is why I tried clear text (didn't know that would work). 

I set the password path, compiled without tls. 

I followed the trek script and post install guide to a T. 

https://www.google.com/url?sa=t&source=web&cd=&ved=2ahUKEwidhbzO8pCIAxUKFlkFHRdjLbYQFnoECA8QAQ&url="">


From: mosquitto-dev <mosquitto-dev-bounces@xxxxxxxxxxx> on behalf of Ben Hardill via mosquitto-dev <mosquitto-dev@xxxxxxxxxxx>
Sent: Sunday, August 25, 2024 4:17:21 AM
To: mosquitto-dev@xxxxxxxxxxx <mosquitto-dev@xxxxxxxxxxx>
Cc: Ben Hardill <hardillb@xxxxxxxxx>
Subject: Re: [mosquitto-dev] Authentication failure
 
Just to be clear.

You are creating a password file in the following format

username:password

Where `password` is the clear text version of the password?

If so this will be the problem. The password file needs to be generated
with the `mosquitto_passwd` file and should be of the following format

username:hashed_password.

You can do this with the mosquitto_passwd comand as follows

mosquitto_passed -b /etc/mosquitto/passwd usename password

The following is from the mosquitto.conf man page

> Set the path to a password file. If defined, the contents of the file are used to control client access to the broker. The file can be created using the mosquitto_passwd(1) utility. If mosquitto is compiled without TLS support (it is recommended that TLS support is included), then the password file should be a text file with each line in the format "username:password", where the colon and password are optional but recommended

Note the second sentence is for is mosquitto is compiled **without**
TLS, the build in the container includes TLS support.

If this is not the case please give a lot more details about how the
password file is being generated and your mosquitto.conf (and any
additional file in the conf.d directory)

On 25/08/2024 04:26, Anthony Falzon III via mosquitto-dev wrote:
> Yes, the service is running, when I change the allow anonymous to yes it
> works.
>
> I ran
> chown mosquitto:mosquitto /etc/mosquitto/passwd
>
> After creating the passwd file, that should take care of file access. It
> also can write to the file because it's generating the auto password
> through your utility.
>
> I have tried a simplified password and that did not work either.
>
>
> ------------------------------------------------------------------------
> *From:* mosquitto-dev <mosquitto-dev-bounces@xxxxxxxxxxx> on behalf of
> Peter Rockett via mosquitto-dev <mosquitto-dev@xxxxxxxxxxx>
> *Sent:* Saturday, August 24, 2024 3:30:33 AM
> *To:* mosquitto-dev@xxxxxxxxxxx <mosquitto-dev@xxxxxxxxxxx>
> *Cc:* Peter Rockett <p.rockett@xxxxxxxxxxxxxxx>
> *Subject:* Re: [mosquitto-dev] Authentication failure
>
> Is the mosquitto service actually running?
>
> As of mosquitto version 2.0.18 (at least), the passwd file requires read
> access for the ‘mosquitto’ user that is created when installing the
> software.  Otherwise starting the mosquitto service fails. This is
> documented, but is easy to overlook.
>
> P.
>
>
> On 24/08/2024 03:31, Anthony Falzon III via mosquitto-dev wrote:
>> I am using tteks script to install mqtt as a docker LXC.
>>
>> Install went fine, created the passwd file, which generated:
>> <username>:<auto generated password>
>>
>> I am getting an authorization error when using the username or
>> password in that file.
>>
>> conf.d does point to that file. allow_anonymous is set to false. If I
>> change it to true and comment out my password/username I everything
>> works as expected.
>>
>>
>> I'm failing in Z2MQTT and Home Assistant.
>>
>>
>>
>> _______________________________________________
>> mosquitto-dev mailing list
>> mosquitto-dev@xxxxxxxxxxx  <mailto:mosquitto-dev@xxxxxxxxxxx>
>> To unsubscribe from this list, visithttps://www.eclipse.org/mailman/listinfo/mosquitto-dev  <https://www.eclipse.org/mailman/listinfo/mosquitto-dev>
>
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

--
https://www.hardill.me.uk/wordpress
https://github.com/hardillb
https://about.me/hardillb
https://flickr.com/photos/hardillb/
https://keybase.io/hardillb
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top