Hi, I’ve been struggling for over a day trying to get access from a Windows PC to my Docker Volume folders. Whilst this may be a pure samba issue it may be complicated due to using Docker. I’m new to Docker and it’s a year or so since I was last involved in Linux.
So far:
- Raspberry Pi 4 with a base image of Raspbian 10 Buster + Asterisk 16.6.1 & FreePBX 15.0.16.22
- Installed Docker version 19.03.5, build 633a0ea
- Installed Docker-Compose version 1.25.0, build b42d419
- Installed Container Portainer 1.22.2
- Installed Container Eclipse Mosquitto arm32v7/eclipse-mosquitto:1.6"
- Installed Container openHAB 2.4.0
All done as root and all accessible via browser on a Windows 7 PC.
I was following 2 guides github and openhab community
- Defined openhab group and user:
- sudo useradd -r -s /sbin/nologin openhab
- sudo usermod -a -G openhab pi << later changed pi to openhab
I now realise that one guide said one should explicitly define user & group IDs but I’ve addressed that below.
_
8. Defined Docker-Compose script. The Volume & Environment lines are:
-v /var/lib/docker/volumes/openhab_data/openhab_addons:/openhab/addons \
-v /var/lib/docker/volumes/openhab_data/openhab_conf:/openhab/conf \
-v /var/lib/docker/volumes/openhab_data/openhab_userdata:/openhab/userdata \
USER_ID: 999
GROUP_ID: 994
These IDs were confirmed by:
- $ stat /var/lib/docker/volumes/openhab_data/
- Access: (0755/drwxr-xr-x) Uid: ( 999/ openhab) Gid: ( 994/ openhab)
- $ stat /var/lib/docker/volumes/
- Access: (0700/drwx------) Uid: ( 0/ root) Gid: ( 0/ root)
In order to edit the openHAB config files within the var/lib/docker/volumes/openhab_data/ folder using Visual Studio Code on a Windows 7 Professional PC, I defined the following Samba config (here’s just the changes to the default samba conf file):
- workgroup = OFFICE
- wins support = yes
- valid users = openhab <<< was valid users = pi, openhab
- [openHAB2]
- comment=openHAB2
- path=/var/lib/docker/volumes/openhab_data
- browseable=Yes
- writeable=Yes
- only guest=no
- public=no
- create mask=0777
- directory mask=0777
- valid users = openhab <<<<< was added later but kept under home section as well
- force group = openhab <<<<< was added later
In Windows 7 Network using the IP address of the Pi the openHAB2 Share icon appears but I cannot get access:
- “Windows cannot access openHAB2 / You do not have permission to access”
Tried $ testparm shows [openHAB2]
- [openHAB2]
- comment = openHAB2
- create mask = 0777
- directory mask = 0777
- force group = openhab
- path = /var/lib/docker/volumes/openhab_data
- read only = No
- valid users = openhab
And $ ls -l /var/lib/docker/volumes/openhab_data shows:
- drwxr-xr-x 2 openhab openhab 4096 Nov 30 21:38 openhab_addons
- -rw-r–r-- 1 openhab openhab 770 Dec 3 12:43 openhab-compose-file.yml
- drwxr-xr-x 13 openhab openhab 4096 Dec 17 2018 openhab_conf
- drwxr-xr-x 8 openhab openhab 4096 Nov 30 21:39 openhab_userdata
In my experimenting I did at times get a Windows network login dialog box but could not log in. Now I cannot get that, but just the denied message.
=======================
Greatly appreciated if someone could help put a stop to my hurting head
Sorry it’s a long post and I’ve struggled with the formatting with no apparent “code” markup.
Many thanks,
Alan
PS I would like to avoid solutions that eliminate security and let the whole world have read/write access!!
PS2 Another 2-3 hours today Tried Putty but found I could not login as openhab user. Can login as root. I did check/reset the Samba and system passwords for openhab user. Tried another Windows 7 PC and it’s the same issue.