首先要找到你現在使用的samba版本,並下載其原始碼
# rpm -q samba
samba-3.0.32-0.fc8
至 Samba 官方網站下載對應的 Source 位置 http://us1.samba.org/samba/ftp/old-versions/
#wget http://us5.samba.org/samba/ftp/old-versions/samba-3.0.32.tar.gz
再下載samba-vscan模組
#wget http://www.openantivirus.org/download/samba-vscan-0.3.6c-beta5.tar.gz
開始安裝
#cd /usr/local/src
#tar xvf /root/samba-3.0.32.tar.gz
#cd samba-3.0.32/examples/VFS/
#tar xvf /root/samba-vscan-0.3.6c-beta5.tar.gz
#cd /usr/local/src/samba-3.0.32/source/
#./configure
#make headers
#cd ../examples/VFS/samba-vscan-0.3.6c-beta5/
#./configure
#make
#cp vscan*.so /usr/lib/samba/vfs/
#cp */vscan-*.conf /etc/samba/
接下來裝clamav
#yum install clamav*
再smb.conf也要加入支援samba-vscan,請再全域設定加入以下選項
vfs object = vscan-clamav
vscan-clamav: config-file = /etc/samba/vscan-clamav.conf
接著要修改 /etc/samba/vscan-clamav.conf 設定
max file size = 0 (設定部掃描超過多少bytes的檔案,”0”不設限)
verbose file logging = yes (是否產生記錄)
scan on open = yes (檔案開啟時掃描)
scan on close = yes (檔案關閉時掃描)
deny access on error = yes (設定當 samba-vscan 無法呼叫掃毒模組時是否要拒絕所有檔案存取)
deny access on minor error = yes (設定當 samba-vscan發生任何細微錯誤時是否要拒絕所有檔案存取)
send warning message = yes (設定當samba-vscan發現病毒時,要不要使用 windows messenger 送出警告)
infected file action = quarantine (發現病毒時動作 delete 刪除 quarantine 隔離 nothing 沒事不作任何動作)
quarantine directory = /tmp (隔離目錄)
quarantine prefix = vir- (隔離檔標頭名稱)
clamd socket name = /tmp/clamd (請設定與 /etc/clamd.conf 裡 LocalSocket 的值相同)
最後重新啟動 samba 及 clamav
開啟window xp messenger 服務
測試訊息傳遞
測試防毒效果,先去http://www.eicar.org/anti_virus_test_file.htm 下載測試病毒,再轉存到samba上
留言列表