Many anti-virus software in UNIX/Linux are commercial versions. However, in Windows systems, the quality of anti-virus software depends on the quantity of virus databases and the update speed.
Here, we use the free software Clam AntiVirus to establish a virus detection and removal system in Linux.
To eliminate future risks, we recommend that you build a virus detection and removal system before the server becomes public.
Note: The system must install the ntp service, and the time must be the same as that of Beijing time; otherwise, the clam may be unavailable. As follows:
Yum-y install ntp
/Usr/sbin/ntpdate pool.ntp.org
(1) Because Clam Antivirus does not exist in the official yum library of CentOS, You need to define unofficial libraries to install Clam Antivirus with yum. As follows:
Vim/etc/yum. repos. d/dag. repo is 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 # install Clam AntiVirus online
(4) freshclam # update the clam virus Database
(5) chkconfig clamd on # Set it to start after the system starts
(6) service clamd start # start clamd antivirus software
(7) clamdscan # scan for Anti-Virus
Test: download the software with viruses:
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 -- 1 root 68 Jul 19 11: 20 eicar.
-Rw-r -- 1 root 184 Jul 19 :19 eicar_com.zip
-Rw-r -- 1 root 3676 Jul 13 linux. sh
[Root @ MYSQL-01 opt] # clamdscan *
/Opt/eicar_com.zip: Eicar-Test-Signature FOUND # discover infected files
/Opt/eicar.com: Eicar-Test-Signature FOUND # locate file INFECTED WITH VIRUS
/Opt/linux. sh: OK
----------- Scan summary -----------
Infected files: 2
Time: 0.005 sec (0 m 0 s)
[Root @ MYSQL-01 opt] # clamdscan -- remove # exclude scan again and add the delete option
/Opt/eicar_com.zip: Eicar-Test-Signature FOUND
/Opt/eicar_com.zip: Removed. # uninstall Delete the infected file
/Opt/eicar.com: Eicar-Test-Signature FOUND
/Opt/eicar.com: Removed. # delete a virus-infected file
----------- Scan summary -----------
Infected files: 2
Time: 0.007 sec (0 m 0 s)
[Root @ MYSQL-01 opt] # clamdscan * # No virus file is available now.
/Opt/linux. sh: OK
----------- Scan summary -----------
Infected files: 0
Time: 0.001 sec (0 m 0 s)
This article is from the IMySQL blog, please be sure to keep this source http://jiechao2012.blog.51cto.com/3251753/1292937