Samba 公共文件夹和“Dropbox”文件夹

Samba 公共文件夹和“Dropbox”文件夹

我想为我的用户创建一个特殊的组目录结构。

/home/groupAgroupA-每个用户groupA可以创建/编辑/删除文件的主文件夹

/home/groupA/Public- 公共文件夹,每个用户都可以读取文件

/home/groupA/Public/Dropbox- 每个用户都可以写入文件的文件夹,但只有用户groupA可以访问此目录并创建/编辑/删除文件

我现在有:

4 drwxrwx--t 10 nobody groupA 4096 Feb 18 15:44 /home/groupA  
4 drwxrwxr-x  7 nobody groupA 4096 Feb 18 15:40 /home/groupA/Public/    
4 drwxrwx-w- 10 nobody groupA 4096 Feb 18 15:55 /home/groupA/Public/Dropbox

我的smb.conf包含以下条目

[groupA]  
path = /home/groupA  
comment = Folder for users of groupA    
browseable = yes  
read only = no  
create mask = 0770  
directory mask = 0770  
force group = groupA

[groupA Public]
path = /home/groupA/Public
comment = Admins Public   
Browseable = yes  
write list = @groupA  
create mask = 0775  
directory mask = 0775  

[groupA DropBox]  
path = /home/groupA/Public/Dropbox  
comment = groupA Dropbox  
read only = no   
valid users = @groupA  
browseable = yes  
inherit owner = yes  
directory mode = 3770  
force directory mode = 3770

工作部分是的用户groupA可以访问并充分使用/home/groupA。所有用户都可以/home/groupA/Public/从那里访问和读取文件。

我的问题是所有用户(即使不在 中的用户groupA)都可以访问/home/groupA/Public/Dropbox并查看所有文件。我只希望他们能够将文件放入其中,但看不到文件夹的内容,并禁止他们删除其中的任何文件。

有人知道可能是什么问题以及我该如何解决它吗?

答案1

不幸的是,不可能创建一个不能列出内容但可以写入文件的文件夹,当 Windows 看到这种情况时就会发疯。

大多数用户无法通过 FTP 处理此类问题,因为这是相当常见的配置。

您需要使用某种允许发布文件的网站。

答案2

我们在 Debian Linux 上为我们的学区做了这类事情。我们在以下位置设置共享smb.conf

[Classwork]
path = /usr/local/share/Classwork
inherit permissions = yes
writeable = yes
comment = "All users can read contents and subfolders; only staff can write to it"

[Dropbox]           
path = /usr/local/share/Dropbox
writeable = yes
inherit permissions = Yes
comment = "All users can see the Dropbox folder, and each staff member has a group. Students (or teachers) can drag files into the folder, but not open them up. Only the staff member who owns the folder can open it, or its contents"

在文件系统中设置文件夹的权限,而不是在 Samba 中。尝试一下,然后报告结果。

答案3

您希望 Dropbox 具有写入权限,但没有读取权限。因此 773 允许其他人将文件写入文件夹,但只有所有者和组可以读取它们。

编辑:误读了 Dropbox 的前提。

所以,事实证明我误读了整个问题,不知道问题是什么。但我确实发现本文,如果你还没有读过的话它可能会有所帮助。

相关内容