Mosquitto password encrypt

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.2.10.3 (stable)
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

If your request is related to an app, specify its name and version: mosquitto 2.0.14~ynh2

Description of my issue

I installed the Mosquitto program. It works as expected with the username and password entered during installation. However, when I add a new user, it gives an authentication error. The password file contains a new user, but I think the hash algorithm used in the installation is not the same as the algorithm used by the ‘mosquitto_passwd’ command when adding a new user. If I edit the file and copy the password of the user created during the installation to the new user, the new user connects without any problems. What should I do to add a new user to the program in the standard way? Thanks in advance for your interest.

The password file contains a new user, but I think the hash algorithm used in the installation is not the same as the algorithm used by the ‘mosquitto_passwd’ command when adding a new user.

It literally uses mosquitto_passwd during install to hash the passwords.

How are you adding the new user?

From servers terminal ‘mosquitto_passwd -b /etc/mosquitto/passwd user password’

Does this return success? Is the file modified? Don’t you have to run with sudo? If the file is updated - is the password hashed or stored plaintext?

In the previous message I entered the command with sudo.

sudo mosquitto_passwd /etc/mosquitto/passwd user
Warning: File /etc/mosquitto/passwd owner is not root. Future versions will refuse to load this file.To fix this, use chown root /etc/mosquitto/passwd.Warning: File /etc/mosquitto/passwd group is not root. Future versions will refuse to load this file.
Password: *******
Password: *******

After entering this data, when I tried to log in, it failed. After restarting the service, it connected.
The problem was the need to restart the service.
Thank you for your help.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.