Category: How to..., Installation, Linux Projects - Hands On — UbuntuLinuxHelp @ 12:14 pm —

Last month we posted “Does Ubuntu Linux Really Need Antivirus Software?” Where there was a bit of discussion as to whether Linux needed antivirus software installed.spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to
There were some very informative comments from readers, which showed that in reality it would be very difficult to develop Linux based viruses, and that the real use would be to protect Windows users. After some thought and a bit of playing, I was introduced to ClamAV. For those not familiar, their site description says:spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

…Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX, designed especially for email scanning on mail gateways. It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command line scanner and advanced tool for automatic database updates. The core of the package is an anti-virus engine available in a form of shared library…spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

For me at least, this was a clear challenge to roll up my sleeves and create a small antivirus server (used to scan email). This would be useful to the small business owner, school, club or hobbyists in general. I’m not going to post the setup of the mail server for this (there are tons of tutorials on line), I’ll just be writing about the installation of clamAV on the server.spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

Depending on your platform, you should see the appropriate documentation here: http://www.clamav.org/download/packages/packages-linux. However, as I’m using Ubuntu Linux, I’ll simply run the following command on the mail server to install the package:spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

sudo apt-get install clamav clamav-daemon clamav-docs

ClamAV Install

clamav is the software and clamav-daemon is the service that will run the mail server modules that checks email attachments. The daemon will also ensure that the virus definitions are automatically updated. Be aware that the command will also install:spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

clamav-base
clamav-freshclam (Run by the daemon to keep the definitions updated).spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

After the installation is complete, you’ll be able to scan files manually using:spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

sudo clamscan -r /<whatever-directory-name-your-mailserver-uses-to-store-email>

Or… better to have it run automatically using cron like this:spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

sudo vi crontab -e

(you can use nano, vi, whatever, it does not matter - just as long as it’s a pure text editor) and add the following code to the cronjob:spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to

*/10 * * * * sudo clamscan -r /<whatever-directory-name-your-mailserver-uses-to-store-email>

The above will scan the mail directory every 10 minutes.

Again, I’m not espousing that Linux “needs” anti virus protection. Rather, I’m suggesting one method we could use to protect all members, (by attempting to reduce virus transmission) to Windows and other platforms.spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to If you need to remove this solution (because you’re just trying this out), the command to do so would be:

sudo apt-get autoremove clamav clamav-daemon clamav-docs

The “autoremove” statement will also remove the dependencies that were installed with clamav.

You can of course use this solution for your desktops and have it automatically scan the Thunderbird email folder via cron too.spacer_gif Create a Linux Antivirus Server to Protect eMail - A Brief How to ;)

As always, I hope this is helpful to some of you!
:)

There are 2 comment(s) added so far...

#1

[…] 2: For those interested in a simple hands-on project, try this: Create a Linux Antivirus Server to Protect eMail - A Brief How to addthis_url = […]

#2

[…] Rachel wrote an interesting post today onHere’s a quick excerptLast month we posted “Does Ubuntu Linux Really Need Antivirus Software?” Where there was a bit of discussion as to whether Linux needed antivirus software installed. There were some very informative comments from readers, which showed … […]

Anti Virus wrote on April 11, 2008 - 5:49 am
You can leave a response, or trackback from your own site.

Write Your Comment

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.

You should have a name, right? 
Your email address, I promised I won't tell it to anyone. 
If you have a web site or blog, you can type the URL right here. 
This is where you type your comments. 
Remember my information for the next time I visit.