Samba Share – Fixing Access Denied Issue on Accessible Samba Share

samba

I have the following samba config (Centos7):

[global]
netbios name = HomeAssistant
server string = The HA File Center
workgroup = WORKGROUP
hosts allow =
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
remote announce =
remote browse sync =

[HOME ASSISTANT]
path = /home/homeassistant
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = homeassistant
force create mode = 0777
force directory mode = 0777
hosts allow =

I have a homeassistant user and I have given it a samba password. When I connect in Windows to the share I see a "home assistant" folder.

But when I try to open it I get an access denied message.

The /home/homeassistant folder is configured as:

drwxr-xr-x.  4 homeassistant homeassistant 119 Jun 18 22:44 homeassistant

I'm not sure anymore what I'm missing at this point..

Best Answer

Disabling selinux resolved things, but if you want to enable it, use the following command:

chcon -R -t  samba_share_t /home/homeassistant

That will allow the the directory to be accessed via samba through selinux. If selinux is enabled, you'll need to run that command on any samba shares. Be sure to restart the smb service afterwards.