Using Samba for non-openHAB directories

I realize this is not really openHAB related, but since I configured Samba purely following the openHAB docs. And I’m afraid to follow any guidance from the internet, because I don’t want to screw up the openHAB Samba shares, which work.

I thought just appending the following to /etc/samba/smb.conf:

[GedeeldeMap]
  comment=Gedeelde map van mini-pc kelder
  path=/home/erik/Openbaar
  browseable = yes
  writeable=Yes
  only guest=no
  public=no
  create mask=0777
  directory mask=0777

… and running this:

erik@MinipcLG2:/var/log/samba$ sudo chown -hR openhab:openhab /home/erik/Openbaar
erik@MinipcLG2:/var/log/samba$ sudo service smbd restart

… would do the trick.

But no:


(I apparently don’t have access…)

(I’m running Linux Mint, by the way.)

Does anyone have an idea what the problem might be?

You did

chown -hR openhab:openhab /home/erik/Openbaar

but what is the permission of /home/erik ? Is it (r,) x for others ?

erik@MinipcLG2:/home$ ls -pal
totaal 24
drwxr-xr-x  4 root root  4096 nov 21 15:12 ./
drwxr-xr-x 25 root root  4096 sep  6 06:19 ../
drwxr-xr-x  3 root root  4096 nov 17  2023 .ecryptfs/
drwx------ 27 erik erik 12288 nov 21 15:25 erik/

Maybe there’s a better place for this shared folder?

try if

chmod o+x /home/erik

solves the problem.
With that configuration one need to know file/directory names inside of /home/erik to find them.

1 Like

Hooray! Thanks!

I then noticed that I can’t e.g. touch tweedetest.txt as user erik in that folder. That’s probably logical, since it’s owned by user openhab, but not very practical :stuck_out_tongue:

Some googling led me to this:

erik@MinipcLG2:~/Openbaar$ sudo setfacl -m u:erik:rwx /home/erik/Openbaar

And now it seems to work in both ways. (I had added test.txt from my Windows laptop). Both files are not owned by the same user, but I guess that doesn’t matter too much?

erik@MinipcLG2:~/Openbaar$ ls -pal
totaal 32
drwxrwxr-x+  2 openhab openhab  4096 nov 21 19:43 ./
drwx-----x  27 erik    erik    12288 nov 21 15:25 ../
-rwxrw-r--   1 openhab openhab     0 nov 21 19:35 test.txt
-rw-rw-r--   1 erik    erik        0 nov 21 19:43 tweedetest.txt