[SOLVED] Openhab2 Samba Share / cannot modify files

  • Platform information:
    • Hyper-v
    • Centos 7 x64
    • Java Runtime Environment: ZULU
    • openHAB version:2.5.0
  • Issue of the topic:
    I have configured samba as outlined in the installation guide for windows. I cannot modify or write to files in the share. I have tried all the suggestions in the forums. I just set everything back to the initial config from the docs. I have been messing with this for a week and seem to be missing something. I can read the files just nothing else.
  • Please post configurations (if applicable):

smb.conf

See smb.conf.example for a more detailed config file or

read the smb.conf manpage.

Run β€˜testparm’ to verify the config is correct after

you modified it.

[global]
wins support = yes
workgroup = workgroup
security = user

    passdb backend = tdbsam

    printing = cups
    printcap name = cups
    load printers = yes
    cups options = raw

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775

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

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

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

testparm output__________________________________
[root@localhost ~]# testparm
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section β€œ[homes]”
Processing section β€œ[printers]”
Processing section β€œ[print$]”
Processing section β€œ[openHAB2-userdata]”
Processing section β€œ[openHAB2-conf]”
Processing section β€œ[openHAB2-logs]”
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

Global parameters

[global]
printcap name = cups
security = USER
wins support = Yes
idmap config * : backend = tdb
cups options = raw

[homes]
browseable = No
comment = Home Directories
inherit acls = Yes
read only = No
valid users = %S %D%w%S

[printers]
browseable = No
comment = All Printers
create mask = 0600
path = /var/tmp
printable = Yes

[print$]
comment = Printer Drivers
create mask = 0664
directory mask = 0775
force group = @printadmin
path = /var/lib/samba/drivers
write list = @printadmin root

[openHAB2-userdata]
comment = openHAB2 userdata
create mask = 0777
directory mask = 0777
path = /var/lib/openhab2
read only = No

[openHAB2-conf]
comment = openHAB2 site configuration
create mask = 0777
directory mask = 0777
path = /etc/openhab2
read only = No

[openHAB2-logs]
comment = openHAB2 logs
create mask = 0777
directory mask = 0777
path = /var/log/openhab2
read only = No

Side note why are you signed in as root?

As to your samba issue add the following to one of your OH shares:

force user = openhab
force group = openhab

I also suggest you remove the following as it is giving unrestricted access to the files/folders on your shares, they are also redundant with the force user/group:

create mask = 0777
directory mask = 0777
1 Like

I made those changes now windows cannot access.

It appears that selinux has been messing it up all this time.

I disabled it and now I can write to the shares.