I have been looking into security lately and noticed there are not many antivirus options on Linux. Today I want to introduce ClamAV, an open-source lightweight antivirus engine.
Features
-
GNU open-source software
-
Fast scanning
-
Detects 35,000 kinds of viruses, worms, and Trojans, including Microsoft Office documents and macro viruses
-
Can scan inside archives (Zip, RAR, Tar, Gzip, Bzip2, …)
-
Strong email scanning
-
Highly extensible
-
Sync the time:
ntpdate time1.aliyun.com
-
Install ClamAV (you can use the Aliyun EPEL repo):
yum install clamav
-
Update the virus database (the first download takes a while):
freshclam
-
Test it by downloading a known-bad file:
-
Scan with
clamscan:clamscan -r /etc/
………… ./.rnd: OK /eicar_com.zip: Eicar-Test-Signature FOUND ./.cshrc: OK …………
----------- SCAN SUMMARY -----------Known viruses: 5748467 Engine version: 0.99.2 Scanned directories: 1 Scanned files: 15 Infected files: 1 Data scanned: 0.10 MB Data read: 91.95 MB (ratio 0.00:1) Time: 19.179 sec (0 m 19 s)
You can add the
--remove
flag to delete the infected files as soon as the scan finds them.
You can also add a cron job to scan and update the virus database on a schedule — I will not go into that here.
If you find a virus that ClamAV cannot detect, you can submit the sample at:
http://www.clamav.net/sendvirus.html
Official site:
http://www.clamav.net/lang/en/
http://www.clamav.net/sendvirus.html