Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Authentication with user and password - Error: Unable to open pwfile

Hi @all,

on my Raspberry Pi I want all clients to use  a username and password before publish or subscribe a topic. But the following issue occurs and can not fix it.

This is my mosquitto.conf file (without comments):

pid_file /var/run/

persistence true

persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.

include_dir /etc/mosquitto/conf.d

This is my mosquittoCCZ.conf file within "/etc/mosquitto/conf.d"

# Standard Listener

#listener 1883

protocol mqtt

log_type error

log_type warning

log_type notice

log_type information

# Websockets Listener

listener 9001

protocol websockets

log_dest syslog

log_dest stdout

connection_messages true

log_timestamp true

allow_anonymous false

password_file etc/mosquitto/passwordsvpj

This is the error:

pi@raspberrypi:~ $ sudo mosquitto -c /etc/mosquitto/mosquitto.conf

1539358641: mosquitto version 1.5.3 starting

1539358641: Config loaded from /etc/mosquitto/mosquitto.conf.

1539358641: Error: Unable to open pwfile "etc/mosquitto/passwordsvpj".

1539358641: Error opening password file "etc/mosquitto/passwordsvpj".

Some more information:

pi@raspberrypi:~ $ ls -la /etc/mosquitto/

insgesamt 36

drwxr-xr-x   5 root root  4096 Okt 12 17:22 .

drwxr-xr-x 121 root root 12288 Okt  6 11:26 ..

drwxr-xr-x   2 root root  4096 Okt  6 11:24 ca_certificates

drwxr-xr-x   2 root root  4096 Okt  6 11:24 certs

drwxr-xr-x   2 root root  4096 Okt 12 17:22 conf.d

-rw-r--r--   1 root root   348 Aug  8 16:14 mosquitto.conf

-rw-r--r--   1 pi   pi     585 Okt 12 16:51 passwordsvpj

Can somebody help me? I was looking for a solution in a lot of forums but wasn't successful.

Thanks in advance

Back to the top