HOWTO : Home made NAS server with Ubuntu 8.04.1 – Part VI

This part is also optional. The Samba is shared with Windows desktops that files stored in the Samba will be infected by virus. To prevent this, you should install the ClamAV, the open source anti-virus program for Linux that kills Windows virus.


Edit /etc/apt/sources.list and append the following lines at the end of the file :
sudo nano /etc/apt/sources.list

# ClamAV PPA
deb hardy main
deb-src hardy main

sudo apt-get update
sudo apt-get install clamav clamav-daemon arj unzoo lha unrar

Make sure clamav-daemon is running :
ps ax | grep clamd

If not :
sudo /etc/init.d/clamav-daemon start
sudo /etc/init.d/clamav-freshclam start

Scan and kill virus if found at 03:00am on every day :
sudo crontab -e

0 3 * * * clamscan -r -i –remove /home > /home/samiux/scan.txt

Remember to configure the ClamAV’s 15 threads to 3 or less in order to reduce the consumption of CPU resources but the con is that it take a longer time to complete the virus scan of the whole system :
sudo dpkg-reconfigure clamav-base

Remarks : The current version of ClamAV at the time of this writing cannot scan RAR files. It is a bug and it will be fixed later.

2 Responses

  1. Hi,

    The crontab entry you specified will spawn a scan every minute, I think you
    need a zero in front of this. You can also use “nice” command in front of the
    clamscan to set the priority of the task.

    “0 3 * * * clamscan -r -i –remove /home > /home/samiux/scan.txt”


  2. […] NAS – Part IV (BitTorrent) (6) NAS – Part IV(a) (BitTorrent) (7) NAS – Part V (System Tunning) (8) NAS – Part VI (ClamAV) (9) NAS – Part VII (Music Server) (Coming soon) (10) IP-PBX (VoIP […]

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your 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

%d bloggers like this: