Oct 24

1. Introduction

I've got a FreeBSD 8 machine at home running mldonkey for downloading of several bitorrents and (still) edonkey files. Recently , because i don't impose connecting only to approved servers, i started getting 'viruses' as windows adwares through the files i'm downloading. Eventually I decided to install some kind of an anti virus on the machine to scan automatically these files.

OpenSource community offers today a vast amount of free anti viruses solution and some even in payment for BSD systems. I choose ClamAV after verifying with virus-total.com several of my compremised files and it recognized most of them.

2. Installation - Install Clamav

    BSD# cd /usr/ports/security/clamav && make install

 


3. Edit rc.conf file and insert these lines

    clamav_freshclam_enable="YES"

    clamav_clamd_enable="YES"

4. Starting Clamav Daemon

    BSD# /usr/local/etc/rc.d/clamav-clamd start

5. POST Installation - Update virus database

   BSD# /usr/local/bin/freshclam
ClamAV update process started at Mon Oct 24 21:10:15 2011
main.cld is up to date (version: 54, sigs: 1044387, f-level: 60, builder: sven)
daily.cld is up to date (version: 13844, sigs: 15913, f-level: 60, builder: guitar)
bytecode.cld is up to date (version: 152, sigs: 38, f-level: 60, builder: edwin)

6. Update crontab to run freshclam every night. Add the following to your crontab:

00     2     *     *     *      /usr/local/bin/freshclam

15.9.14 UPDATE: As stated by one of our readers, Leander Schäfer, The above cronjob is not needed when freshclam daemon is configured via rc.conf (clamav_freshclam_enable="YES").


6. Example fo running a clamscan:

   BSD# clamscan -r -i -l scan.txt /home


(For scan plus remove use :

    BSD# clamscan -r -i –remove -l scan_home.txt /home/mother/Prince)

 

7. Verify Scan

   See the report :
    BSD# cat scan.txt

 

Enjoy.

Viewed 21003 times.
Share |