Installing and configuring ClamAV Antivirus on your UBUNTU

This tutorial is not written from scratch. I would like to thank all people who
enlightened me about Linux and Open source. This tutorial acknowledges the
help of Ubuntu Community (Docs) and some online tutorials from where I
gained some initial knowledge about Linux antivirus.
Now you might be wondering that why I mentioned this Anti-Virus tool. Linux
is supposed to be virus free? Actually calling Linux virus free is not correct.
Linux is carefully engineered in such a way that it’s pretty tough for viruses
to run. There is a concept called permissions or authorization which restricts
running of viruses. This concept lacks in windows which makes it so much
susceptible to virus threats.
Now the question is why a Linux antivirus? Just think of the case, you are
hosting a website on your Linux system and the site allows uploading of files
by users. If a user (by mistake) running windows uploads a virus infected
file? Your OS will not suffer but just think of the case that file is downloaded
by another user running windows and executed. The site will become a
source of virus infection. To prevent this there are many antivirus for Linux
which detect windows viruses though not much viruses are present around
for Linux. This can be used to scan attachments of the mail that are sent
from your server. Here I use ClamAV, it’s a command line antivirus with no
GUI, who needs it now when command line works better? It only detects
viruses but does not remove it. It can detect viruses for nearly all platforms.
Installing ClamAV:
You can install one of the two packages depending upon how you are going
to use the antivirus. If you are going to use it manually, means starting the
antivirus when required. In this case you should get the clamav package.
sudo apt-get install clamav
For automated use install the package clamav-daemon
sudo apt-get install clamav-daemon
After installing you may be asked to configure the antivirus like updates, I
recommend automatically since its updates are very small.
Scanning Using ClamAV:
Use the command clamscan
Let’s check out some examples
To check each file, displaying name of each file: clamscan –r /
To check all files,display only infected file and ring a bell if infected files are
found: clamscan -r –bell -i /
After scan is completed it generates a scan summary.
Updating virus definitions:
Use the command freshclam
Finally one more point, clamscan can inspect only those file for which the
user is authorized to read. For checking all files use sudo prefix.

Advertisements

9 thoughts on “Installing and configuring ClamAV Antivirus on your UBUNTU

  1. i could not install clamav my system some error was found
    the following error is
    The following packages have unmet dependencies:
    clamav-daemon: Depends: libclamav2 (>= 0.91.2) but it is not going to be installed
    E: Broken packages

  2. Hi there,
    Have you tried configuring Apache with mod_clamav to scan incoming http stream packet data? I could generate the mod_clamav by compiling. But not able configure properly to scan files from a http stream.
    Any help will be highly appreciated.

    Thanks.

    1. Hi there,Have you tried configuring Apache with mod_clamav to scan iniomcng http stream packet data? I could generate the mod_clamav by compiling. But not able configure properly to scan files from a http stream.Any help will be highly appreciated.Thanks.

  3. hi, a linux noobie here… wanna check with u, how do u configure ur clamav.conf file so that it blocks and scan for infected file from being downloaded onto ur linux machine?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s