1、安装Clam AntiVirus
由于Clam Antivirus不存在于CentOS中yum的官方库中,所以用yum安装Clam Antivirus需要定义非官方的库。请先确认相应非官方库文件的存在。

[root@www ~]# ls -l /etc/yum.repos.d/dag.repo   ← 确认相应库文件的存在性

如没有添加yum 非官方源请参考:http://lovesunfeel.blog.sohu.com/95480500.html

然后,通过yum来在线安装 Clam Antivirus 。

[root@dammit ~]# yum -y install  clamd

2、运行 Clam AntiVirus

让 Clam Antivirus 开始运行,并设置其为自启动。

[root@dammit ~]# chkconfig clamd on   ← 将其设置为自系统启动后启动

[root@dammit ~]# chkconfig –list clamd
clamd 0:off 1:off 2:on 3:on 4:on 5:on 6:off  ← 确认2–5为on的状态就OK

[root@dammit ~]# /etc/rc.d/init.d/clamd start  ← 启动clamd服务(运行Clam AntiVirus)

Starting Clam AntiVirus Daemon:      [ OK ]  ← 启动成功

3、更新病毒库

[root@dammit ~]#freshclam  ← 更新

4、病毒扫描和升级的计划任务设置

这里有一点要提到的是要用的的Crontab,在我的centos上并没有安装,所以可以参考《Crontab的安装、配置及举例》。

crontab -e

 

我填写的是

30 2 * * * root /usr/bin/freshclam

30 3 * * * root /usr/bin/clamscan ../ -r –remove

具体能不能用我还在验证。


 

测试杀毒软件的样本