2009-11-05

Virus scanning on Ubuntu

You might need to download files on your Ubuntu machine (or any Linux running Gnome) that are intended for Windows machines or you might have fear getting one of the few Linux viruses (yes, there are some).

There is the free clamav software. On Ubuntu (at least 9.04 Jaunty and 9.10 Karmic) there are the following packages available:
clamav
anti-virus utility for Unix - command-line interface

clamav-base
anti-virus utility for Unix - base package

clamav-daemon
anti-virus utility for Unix - scanner daemon

clamav-freshclam
anti-virus utility for Unix - virus database update utility

clamtk
graphical front-end for ClamAV

klamav
KDE frontend for ClamAV
nautilus-clamscan
Antivirus scanning for Nautilus

There is one problem with the clamtk (the gnome GUI tool for scanning) - at least under Karmic used together with Thunderbird: Thunderbird tries to open all files with the clamtk and there if you change that it does not remember the change. And this although I don't want to scan everything automatically (even text files).

And there is a problem with with the nautilus-clamscan (at least under Karmic): It hangs in an infinite scan for the first file.

So whatever I tried, everything is annoying. Solved it the following way:
apt-get remove clamtk
apt-get install nautilus-actions (if not already installed)
Then I created a new nautilus action (via System->Preferences->Nautilus Actions Configuration) with the following command (enabled for files and folders and multiple selections):
path: gnome-terminal
parameters: -x /opt/clamscan.sh %M
And I have created the clamscan.sh with the following content (and set to be readable and executable for everyone):
#!/bin/bash
clamscan $@
read line

Last but not least:
chmod 755 /opt/clamscan.sh


Now I can scan files with clamav on demand using the context menu in Nautilus.

Releated posts: Stationary under Ubuntu, Change hostname on Ubuntu.

2 comments:

Anonymous said...

It's a no-win situation - either ClamTk is set up to scan lots of file types, or very few. Either way you alienate people. Go try the newest version, 4.20.

Martin Wildam said...

A related menu entry is now automatically available in Ubuntu 10.04 - so this post should be basically obsolete.