Samba 共享可访问但访问被拒绝

Samba 共享可访问但访问被拒绝

我有以下 samba 配置(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 =

我有一个 homeassistant 用户,我给了它一个 samba 密码。当我在 Windows 中连接到共享时,我看到一个“home assistant”文件夹。

但当我尝试打开它时,我收到一条拒绝访问消息。

/home/homeassistant 文件夹配置如下:

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

我不再确定我此时错过了什么。

答案1

禁用selinux已解决的事情,但如果您想启用它,请使用以下命令:

chcon -R -t  samba_share_t /home/homeassistant

samba这将允许通过访问目录selinux。如果selinux启用,则需要在任何共享上运行该命令。之后samba请务必重新启动服务。smb

相关内容