啟用 “資源回收筒" 功能, 可救回誤刪的檔案.
啟用稽核記錄, 可追查誰動了哪個檔案.
環境: Fedora 9, Samba 3.2.11-0.28.fc9
啟用 Samba extd_audit 與 recycle 模組
建立資源回收筒目錄
mkdir -p /share/smbshare /share/recycle
chmod 1777 /share/smbshare
chmod 777 /share/recycle
設定/etc/smb.conf 啟用稽核記錄及資源回收筒
vi /etc/samba/smb.conf
代碼: 選擇全部
[global]
log level = 0 vfs:0
log file = /var/log/samba/log.%m
max log size = 0
[share]
path = /share/smbshare
comment = Shared Folder
create mask = 0770
directory mask = 0775
public = yes
writeable = yes
<span style="color: #3366ff;">vfs objects = extd_audit recycle</span>
<span style="color: #3366ff;">recycle: keeptree = yes</span>
<span style="color: #3366ff;">recycle: repository = ../recycle/%u</span>
<span style="color: #3366ff;">recycle: exclude = .tmp|.temp</span>
<span style="color: #3366ff;">recycle: versions = yes</span>
<span style="color: #3366ff;">[recycle]</span>
<span style="color: #3366ff;">path = /share/recycle/%u</span>
<span style="color: #3366ff;">comment = Recycle Bin</span>
<span style="color: #3366ff;">browseable = no</span>
<span style="color: #3366ff;">writable = yes</span>