Centos6安装ClamAV杀毒工具


[root@localhost ~]#yum install clamav*
[root@localhost ~]#yum install clamd*
[root@localhost ~]# chkconfig clamd on
[root@localhost ~]# chkconfig –list clamd
clamd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost ~]# service clamd start
Starting Clam AntiVirus Daemon: LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
root@localhost ~]# freshclam  #升级病毒库
ClamAV update process started at Thu Jan 10 15:53:58 2013
main.cvd is up to date (version: 54, sigs: 1044387, f-level: 60, builder: sven)
WARNING: getfile: daily-15077.cdiff not found on remote server (IP: 202.118.1.40)
WARNING: getpatch: Can’t download daily-15077.cdiff from db.cn.clamav.net
WARNING: getfile: daily-15077.cdiff not found on remote server (IP: 200.236.31.1)
WARNING: getpatch: Can’t download daily-15077.cdiff from db.cn.clamav.net
WARNING: getpatch: Can’t download daily-15077.cdiff from db.cn.clamav.net
WARNING: Incremental update failed, trying to download daily.cvd
Downloading daily.cvd [100%]
daily.cvd updated (version: 16457, sigs: 530720, f-level: 63, builder: neo)
Downloading bytecode.cvd [100%]
bytecode.cvd updated (version: 209, sigs: 40, f-level: 63, builder: neo)
Database updated (1575147 signatures) from db.cn.clamav.net (IP: 200.236.31.1)
WARNING: Clamd was NOT notified: Can’t connect to clamd through /var/run/clamav/clamd.sock
connect(): No such file or directory
[root@localhost ~]# service clamd start
Starting Clam AntiVirus Daemon: [ OK ]
[root@localhost ~]# clamscan   #扫描文件
/root/.cshrc: OK
/root/.imsettings.log: OK
/root/.esd_auth: OK
/root/clamav-0.97.6-1.el6.rf.x86_64.rpm: OK
/root/install.log: OK
/root/.recently-used.xbel: OK
/root/clamd-0.97.6-1.el6.rf.x86_64.rpm: OK
/root/.tcshrc: OK
/root/.bash_logout: OK
/root/clamav-devel-0.97.6-1.el6.rf.x86_64.rpm: OK
/root/.pulse-cookie: OK
/root/install.log.syslog: OK
/root/.bash_profile: OK
/root/.bashrc: OK
/root/.mysql_history: OK
/root/clamav-db-0.97.6-1.el6.rf.x86_64.rpm: OK
/root/.gtk-bookmarks: OK
/root/anaconda-ks.cfg: OK
/root/.bash_history: OK
/root/.Xauthority: Empty file
/root/.ICEauthority: OK
———– SCAN SUMMARY ———–
Known viruses: 1569751
Engine version: 0.97.6
Scanned directories: 1
Scanned files: 20
Infected files: 0
Data scanned: 2.25 MB
Data read: 36.50 MB (ratio 0.06:1)
Time: 3.515 sec (0 m 3 s)
下载病毒文件
[root@localhost ~]#wget http://www.eicar.org/download/eicar.com
[root@localhost ~]#wget http://www.eicar.org/download/eicar_com.zip
[root@localhost ~]# clamscan –remove  #扫描并删除带有病毒的文件
———– SCAN SUMMARY ———–
Known viruses: 1569751
Engine version: 0.97.6
Scanned directories: 1
Scanned files: 23
Infected files: 2
Data scanned: 2.25 MB
Data read: 36.51 MB (ratio 0.06:1)
Time: 3.462 sec (0 m 3 s)
创建扫描脚本,让它自动在一个时间段中自动执行
[root@localhost ~]#vi clamsc.sh
#/bin/bash
date_time=`date +%Y%m%d`
data_path=/mnt
PATH=/usr/bin:/bin
clamscan -r –remove ${data_path} >/var/log/clamdscan_${date_time}.log
[root@localhost ~]#crontab -l
* 12 * * * /clamsc.sh

相关内容

    暂无相关文章