我正在寻找解决 Samba 回收站问题的方法。
我有用户 a1、a2 和 a3,他们都属于 companya 集团。
具有以下配置的 samba 服务器。
[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
# for syslog logging the following parameter to something higher.
syslog = 0
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = no
unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
passwd program = /usr/bin/passwd %u
[Company-A]
comment = Company A Files
path = /samba/share/companya
guest ok = no
browseable = yes
create mask = 0775
directory mask = 0775
writable = yes
valid users = +companya
vfs object = recycle:recycle full_audit:audit
recycle:repository = .trash/%U
recycle:maxsize = 0
recycle:versions = Yes
recycle:keeptree = Yes
recycle:touch = No
recycle:directory_mode = 0775
我的问题是,当用户 a2 删除他的第一个文件后,我得到以下结果。
但是当用户 a1 删除文件时...用户 a1 的垃圾箱不会出现。有人遇到过这种情况吗?
似乎只有第一个删除文件的人才能得到回收站。
我需要让每个用户都有自己的文件夹,而无需手动创建它们。
答案1
这可能不是一个完美的解决方案,但是我注意到该文件夹是由具有 NOT 主要组.trash
的用户创建的,但具有权限,这意味着(每个人)无权创建他的垃圾箱标签。a2
companya
a2
rwxrwxr-x
a1
./trash/a1
rwxrwxr-x a2 a2 --> .trash/
因此将共享配置更改为以下内容:
[Company-A]
comment = Company A Files
path = /samba/share/companya
guest ok = no
browseable = yes
create mask = 0777
directory mask = 0777
writable = yes
valid users = +companya
vfs object = recycle:recycle full_audit:audit
recycle:repository = .trash/%U
recycle:maxsize = 0
recycle:versions = Yes
recycle:keeptree = Yes
recycle:touch = No
recycle:directory_mode = 0704
允许.trash
创建垃圾箱,并rwxrwxrwx
允许其他用户写入他们的垃圾箱,同时保留读取其他垃圾箱的能力。