Tuesday, April 27, 2010

Ubuntu : Install ClamAV

1.ติดตั้ง ClamAV และ Update
apt-get install clamav
apt-get install clamav-daemon
/etc/init.d/clamav-daemon restart
freshclam #update virus definitions
clamscan -r /location_of_files_or_folders


2.Schedule Scan
crontab -e
00 00 * * * clamscan -r location_of_files_or_folders



3.Log and Quarantine
mkdir /var/log/clamav/infected
nano /etc/clamav/clamscan_schedule.sh

ป้อน
#!/bin/sh
### fix log file if needed
LOG_FILE="/var/log/clamav/scan.log"
if [ ! -f "$LOG_FILE" ]; then
touch "$LOG_FILE"
chmod 644 "$LOG_FILE"
chown clamav.clamav "$LOG_FILE"
fi

clamscan -r /public_data --quiet --log="$LOG_FILE" --verbose --move=/var/log/clamav/infected

chmod +x /etc/clamav/clamscan_schedule.sh

No comments: