This is probably the easiest way to install Clamav’s clamscan virus scanner for linux. Assuming you have yum and wget installed, this should be a breeze. Basically we’re just going to add the clamav repo, yum install, and done.
- First login to your shell or remote ssh for the linux server, then type:
cd /etc/yum.repos.d - Now that you are in the yum repos directory, lets download the ClamAV repo:
wget http://www.linux-mail.info/files/dag-clamav.repo - Lets install that bad ass linux virus scanner, ClamAV (clamscan)
yum install clamav clamav-devel clamd - Hit y for yes and anything else required to continue installing.
- To run clamav, simply use the command clamscan. To see a list of options for clamscan, type clamscan -h.
- To update clamav, use the updater, which is freshclam.
Here’s an example clamscan execution command:
clamscan –infected –log=scanresults.txt –recursive –move=/home/backups/ –no-mail ./*
–infected or -i makes it so that clamscan only logs infected files
–log=scanresults.txt or -l scanresults.txt is where you’d like to place scan results (scanresults.txt can be anything)
–recursive or -r scans every directory past the starting point
–move=/home/backups/ is where clamscan will move infected files after they are found
–no-mail tells clamscan to not search mail related files for viruses (usually its phishing and such)
./* is where we would like to search. for instance if you start out in / and use ./* here, then it will scan the whole server.
You can of course replace ./* with any other path that you would like to specifically scan.
For more information, type clamscan -h in shell.
