d--------- 1 mosquitt mosquitt 28 Mar 11 05:28 .
drwxr-xr-x 1 mosquitt mosquitt 26 Nov 17 01:20 ..
so in the container most of these permissions have been modified to be owned by 1883:
/volume1/mosquitto/data$ ls -la
total 4
drwxrwxrwx+ 1 1883 1883 46 Mar 11 05:52 .
drwxrwxrwx+ 1 1883 1883 76 Mar 11 05:28 ..
-rwxrwxrwx+ 1 1883 1883 121 Mar 11 05:52 mosquitto.password_file
I ran your command:
/volume1/mosquitto/data$ sudo chmod 600 ./mosquitto.password_file
/volume1/mosquitto/data$ ls -la
total 4
drwxrwxrwx+ 1 1883 1883 46 Mar 11 05:52 .
drwxrwxrwx+ 1 1883 1883 76 Mar 11 05:28 ..
-rw------- 1 1883 1883 121 Mar 11 05:52 mosquitto.password_file
and tried again:
/volume1/mosquitto/config$ sudo docker run --rm -i -p 1883:1883 -v /volume1/mosquitto/config:/mosquitto/config -v /volume1/mosquitto/data:/mosquitto/data --name mosqTemp eclipse-mosquitto:latest
1646994754: mosquitto version 2.0.14 starting
1646994754: Config loaded from /mosquitto/config/mosquitto.conf.
1646994754: Error: Unable to open pwfile "/mosquitto/data/mosquitto.password_file".
1646994754: Error opening password file "/mosquitto/data/mosquitto.password_file".
the permissions in the container:
/mosquitto/data # ls -la
total 4
d--------- 1 mosquitt mosquitt 46 Mar 11 05:52 .
drwxr-xr-x 1 mosquitt mosquitt 26 Nov 17 01:20 ..
-rw------- 1 mosquitt mosquitt 121 Mar 11 05:52 mosquitto.password_file
Thanks very much for your replies. I really appreciate it. I feel like there's something simple that I am getting wrong but I can't see it!!!