How to build ClamAV antivirus under Linux

Source: Internet
Author: User
Tags zip eicar

Unix/linux anti-virus software is a lot of commercial version. However, as with Windows, the quality of antivirus software depends on the amount of virus library and the speed of the update.

Here, we use free software Clam AntiVirus to build a virus killing system under Linux.

and in order to eliminate the later hidden dangers, it is recommended to build a virus killing system before the server is exposed.

Note: The system must install NTP service, and the time must be consistent with the times, otherwise it will cause clam is not available. As follows:

Yum-y Install NTP

/usr/sbin/ntpdate pool.ntp.org

(1) Since the clam antivirus does not exist in the official library of Yum in CentOS, yum installation with clam antivirus needs to define unofficial libraries. As follows:

Vim/etc/yum.repos.d/dag.repo added, as follows:

[Dag]

Name=dag RPM Repository for Red Hat Enterprise Linux

baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag

Gpgcheck=1

Enabled=1

(2) RPM-UVH http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm # Key authentication for DAG.

(3) yum-y install CLAMD #在线安装 Clam AntiVirus

(4) Freshclam #更新clam的病毒库

(5) Chkconfig CLAMD on #将其设置为自系统启动后启动

(6) Service CLAMD start #启动clamd杀毒软件

(7) Clamdscan #扫描杀毒

Test: Download with virus software:

wget http://www.eicar.org/download/eicar.com

wget Http://www.eicar.org/download/eicar_com.zip

[Root@mysql-01 opt]# LL

Total 24

-rw-r--r--1 root 11:20 eicar.com

-rw-r--r--1 root root 184 11:19 Eicar_com.zip

-rw-r--r--1 root root 3676 03:39 linux.sh

[Root@mysql-01 opt]# Clamdscan *

/opt/eicar_com.zip:eicar-test-signature FOUND #← found a virus-infected file

/opt/eicar.com:eicar-test-signature FOUND #← found a virus-infected file

/opt/linux.sh:ok

-----------SCAN SUMMARY-----------

Infected Files:2

time:0.005 sec (0 M 0 s)

[root@mysql-01 opt]# Clamdscan--remove #← to scan again for viruses and attach deletion options

/opt/eicar_com.zip:eicar-test-signature FOUND

/opt/eicar_com.zip:removed. #← Delete infected files

/opt/eicar.com:eicar-test-signature FOUND

/opt/eicar.com:removed. #← Delete infected files

-----------SCAN SUMMARY-----------

Infected Files:2

time:0.007 sec (0 M 0 s)

[root@mysql-01 opt]# Clamdscan * #现在已经没有病毒文件了.

/opt/linux.sh:ok

-----------SCAN SUMMARY-----------

Infected files:0

time:0.001 sec (0 M 0 s)

Author Signature: 51cto blog Imysql

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.