Install and configure ClamAV Antivirus on CentOS 6

Enable EPEL  repository

CentOS 6.x 32-bit:

# rpm –ivh

CentOS 6.x 64-bit:

# rpm –ivh

Check the repository list.

# yum repolist

Install required ClamAV packages

# yum install clamav clamd

Start the clamd service and set it to auto-start

# /etc/init.d/clamd on
# chkconfig clamd on
# /etc/init.d/clamd start

Update the virus definitions database using command:

# /usr/bin/freshclam

Note: ClamAV will update automatically, as part of /etc/cron.daily/freshclam.)

Set the cron job on a daily / hour / weekly to perform scan . In below example , we are going to create a cronjob on daily  to scan the folder /home/

# vi /etc/cron.daily/dailyscan

/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE

Set the executable permission

# chmod +x /etc/cron.daily/dailyscan

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.