必須先安裝 clamav 掃毒程式,參考文件
http://phorum.vbird.org/view...75809#75809 1.首先將所需套件放置在 /usr/local/src 目錄下
samba-vscan-0.3.5-1.tar.bz2 主程式
samba-2.2.8a.tar.gz samba 原始檔(含有所需函式庫)
2.解壓縮、編譯及安裝
cd /usr/local/src
tar zxvf samba-2.2.8a.tar.gz
cd smaba-2.2.8a/source
./configure
cd ../examples/VFS
tar jxvf /usr/local/src/samba-vscan-0.3.5-1.tar.bz2
cd samba-vscan-0.3.5
./configure
make vscan-clamav.so
cp vscan-clamav.so /usr/lib/samba/vfs
cd clamav
cp vscan-clamav.conf /etc/samba
3.編輯 /etc/samba/smb.conf ,在要掃毒的分享項目,加入掃毒的參數
--------------------------------------------------------
vi /etc/samba/smb.conf
#在要掃毒的分享項目,加入下列兩行
vfs object = /usr/lib/samba/vfs/vscan-clamav.so
vfs options = config-file = /etc/samba/vscan-clamav.conf
存檔離開 :wq
--------------------------------------------------------
4.編輯 /etc/samba/vscan-clamav.conf 檔案,設定使用 clamav 掃毒程式
-------------------------------------------------------
vi /etc/samba/vscan-clamav.conf
將 clamd socket name = /var/run/clamd
libclamav max archived file size = 10 * 1048576
verbose file logging = no
修改為 clamd socket name = /var/run/clamav/clamd.sock
libclamav max archived file size = 30 * 1048576
verbose file logging = yes
存檔離開 :wq
-------------------------------------------------------
5.編輯 /etc/clamd.conf ,取消 TCPSocket 設定,改為 LocalSocket
-----------------------------------------------
vi /etc/clamd.conf
將 TCPSocket 3310
#LocalSocket /var/run/clamav/clamd.sock
修改為 #TCPSocket 3310
LocalSocket /var/run/clamav/clamd.sock
存檔離開 :wq
-----------------------------------------------
6.重新啟動 samba
/etc/rc.d/init.d/smb restart
7.重新啟動 clamav
/etc/rc.d/init.d/clamd restart
_________________
~ 成功者絕不放棄,放棄者絕不成功 ~
...................@_@