Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading password file: Permission denied #3131

Open
dippes opened this issue Oct 9, 2024 · 1 comment
Open

Error reading password file: Permission denied #3131

dippes opened this issue Oct 9, 2024 · 1 comment
Labels

Comments

@dippes
Copy link

dippes commented Oct 9, 2024

Hello

I am trying in vain to generate a password with ‘mosquitto_passwd’, no matter which directory I use, I always get an error message.

root@hp-server:~# mosquitto_passwd -c /etc/mosquitto/conf.d/ dippes
Error reading password file: Permission denied

Has anyone successfully fixed this?

@ckrey
Copy link
Contributor

ckrey commented Oct 9, 2024

The first parameter is supposed to be the name of the password file, not the directory.

Try

mosquitto_passwd -c /etc/mosquitto/conf.d/pwfile dippes

See also:

mosquitto_passwd is a tool for managing password files for mosquitto.

Usage: mosquitto_passwd [-H sha512 | -H sha512-pbkdf2] [-c | -D] passwordfile username
       mosquitto_passwd [-H sha512 | -H sha512-pbkdf2] [-c] -b passwordfile username password
       mosquitto_passwd -U passwordfile
 -b : run in batch mode to allow passing passwords on the command line.
 -c : create a new password file. This will overwrite existing files.
 -D : delete the username rather than adding/updating its password.
 -H : specify the hashing algorithm. Defaults to sha512-pbkdf2, which is recommended.
      Mosquitto 1.6 and earlier defaulted to sha512.
 -U : update a plain text password file to use hashed passwords.

See https://mosquitto.org/ for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants