Samba Share openHAB 2.5 to Win10 and Ubuntu 20.04 LTS

I use a repository based installation of OH 2.5 on a virtual server and a Win 10 Pro desktop and a virtual ubuntu 20.04 LTS desktop to connect to the OH share folders without luck. I installed samba by this guide and activated smb 1.0 support in the windows features and changed the group polices for unsafe guest logon… no joy. I see the folder but have no access from windows either from ubuntu.


grafik

#=============== openHAB Share Definitions ============

[openHAB-userdata]
comment=openHAB userdata
path=/var/lib/openhab
browseable=Yes
writeable=Yes
only guest=no
public=no
create mask=0777
directory mask=0777

[openHAB-conf]
comment=openHAB site configuration
path=/etc/openhab
browseable=Yes
writeable=Yes
only guest=no
public=no
create mask=0777
directory mask=0777

[openHAB-logs]
comment=openHAB logs
path=/var/log/openhab
browseable=Yes
writeable=Yes
only guest=no
public=no
create mask=0777
directory mask=0777

any ideas what I’m missing here?

Hi,
I cannot read German so I don’t know the error messages posted. Have you tried mapping the network drive as openhab or as the local windows user?

image

i tried it with openhab user, ubuntu user, openhabian etc… no access to the folders

Have you ever been able to connect to Samba shares and are you sure Samba is running?

Check with
sudo systemctl status smbd.service

Which user are you using to connect to the openHAB instance? That user should be used to connect from another to the samba share. Reading your OP I doubt the user openhabian exists at all.

smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-01-25 12:48:36 UTC; 1min 7s ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Main PID: 28260 (smbd)
Status: “smbd: ready to serve connections…”
Tasks: 4 (limit: 4663)
CGroup: /system.slice/smbd.service
├─28260 /usr/sbin/smbd --foreground --no-process-group
├─28288 /usr/sbin/smbd --foreground --no-process-group
├─28289 /usr/sbin/smbd --foreground --no-process-group
└─28291 /usr/sbin/smbd --foreground --no-process-group

@opus it’s not the openhab user I use to connected to OH. It’s my personal username. I have althought tried that. “openhabian” was just to verfiy that it’s the repo version

That is out of the way… then what about users/owners and credentials.

is openhab the owner and what about the access rights for f.eks the /etc/openhab folder?
image
and for the content of /etc/openhab ?
image
I guess you are trying to use the openhab user to logon to the share?

There must be the same user that have access rights to the directories as the one you log onto Samba with.

Or, if using the concept of openhabian, write enable all folders/files for members of group and login with a user that is member of group openhab .

Agreed

root@localhost:~# ls -l /etc/openhab2
total 44
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 html
drwxr-xr-x 3 openhab openhab 4096 Jan 14 14:15 icons
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 items
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 persistence
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 rules
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 scripts
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 services
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 sitemaps
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 sounds
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 things
drwxr-xr-x 2 openhab openhab 4096 Jan 14 14:15 transform

openhab is the owner and openhab and me are user of samba:

root@localhost:~# pdbedit -L -w
openhab:111:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:E0BB356FD23AD715E6B55E10D3B85A4C:[U          ]:LCT-600D92F0:
bill:1000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:04E19E6478F036F572FFEAF12D3EE1D3:[U          ]:LCT-600D2F4A:

but it’s not working for openhab

Sorry, I’m running out of ideas. I too run OH3 on Ubuntu 20.04 LTS (server in a VirtualBox VM) with Samba installed using the same guide as you. The only difference is that I only use openhab user to connect the Samba share from a Windows machine (10 Enterprise) and a Mac (both work flawlessly).

Do you see your users and any file locks using sudo smbstatus ?

Perhaps if would be useful to check the logs at /var/log/samba

root@localhost:~# sudo smbstatus

Samba version 4.7.6-Ubuntu
PID Username Group Machine Protocol Version Encryption Signing

Service pid Machine Connected at Encryption Signing

No locked files

here the log from the windows desktop:

canonicalize_connect_path failed for service openHAB-conf, path /etc/openhab
[2021/01/25 13:52:43.412634, 0] …/source3/smbd/service.c:774(make_connection_snum)
canonicalize_connect_path failed for service openHAB-conf, path /etc/openhab
[2021/01/25 13:52:43.413737, 0] …/source3/smbd/service.c:774(make_connection_snum)
canonicalize_connect_path failed for service openHAB-conf, path /etc/openhab

can I change the openhab user or what’s the easiest way to access share folders?
big thanks for your help, really appreciate that

wrong path in the smb.conf, it’s need to be /etc/openhab2 wtf. It’s working now!!!
for anybody else - Check the LOGS!!!

Yes, I (or we?) missed that since it is openhab2 ONLY for the version 2! Version 1 and the actual openhab version 3 are using the folders and service name without the number!
When looking onto the guide from the OP you should have selected a Version 2.X and not the preselected latest (which is version 3).

I used to run 2.5 version and should have picked it up as well. Anyway, it’s good that is @MajorSandfurz found the config error.

1 Like

Hi Bill,
‘path’ in config should point to ‘openhab2’ instead of ‘openhab’ i assume. I had the same issue after restoring SD image on a new card.
See if that helps.