Samba 啟用稽核記錄及資源回收筒功能

目的:
啟用 “資源回收筒" 功能, 可救回誤刪的檔案.
啟用稽核記錄, 可追查誰動了哪個檔案.
環境: Fedora 9, Samba 3.2.11-0.28.fc9
啟用 Samba extd_auditrecycle 模組

建立資源回收筒目錄

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>

/etc/init.d/smb restart

參考資料:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s