简体   繁体   English

samba 文件夹上的 www-data 权限被拒绝

[英]Permission denied for www-data on samba folder

I try to access a samba folder via PHP under Ubuntu 18.04.我尝试通过 Ubuntu 18.04 下的 PHP 访问 samba 文件夹。 The structure is.\media\documents\customers... All files have 0755 set as permission and are owned by smbuser.结构是.\media\documents\customers... 所有文件都设置了 0755 为权限并且归 smbuser 所有。 When I read the directory with scandir, I get a list of all folders.当我用 scandir 读取目录时,我得到了所有文件夹的列表。 But when I try to access a subdirectory, I always get a "failed to open dir: permission denied in...".但是当我尝试访问子目录时,我总是得到“无法打开目录:权限被拒绝...”。

For example:例如:

.\media\documents\customers\clientA -> works and lists all folders .\media\documents\customers\clientA -> 工作并列出所有文件夹

.\media\documents\customers\clientA\videos -> permission denied .\media\documents\customers\clientA\videos -> 权限被拒绝

It works when I change the owner to www-data, but this isn't helpful.当我将所有者更改为 www-data 时它可以工作,但这没有帮助。 I also tried to change the group to www-data, but that has no effect.我也尝试将组更改为 www-data,但这没有效果。

What else can I do?我还可以做些什么?

As I didn't solve my problem I created a folder under /var, sync this via cronjob and change owner of source to www-data.由于我没有解决我的问题,我在 /var 下创建了一个文件夹,通过 cronjob 同步它并将源的所有者更改为 www-data。 It works, but it's not the solution I wanted.它有效,但这不是我想要的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM