【转载】Linux杀毒软件之ClamAV

1.下载安装包

wget https://clamav-site.s3.amazonaws.com/production/release_files/files/000/000/392/original/clamav-0.100.0.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIY6OSGQFGUNJQ7GQ%2F20180607%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180607T032127Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=0348774f89ab0905305738a1238c1e9e26ffeb3d7d7f634beda2bef1c3b6740e

2.创建用户

groupadd clamav 
useradd -g clamav clamav

3.解压并安装

tar xf clamav-0.100.0.tar.gz 
cd clamav-0.100.0/
yum install gcc openssl openssl-devel  -y
./configure --prefix=/usr/local/clamav
make && make install

4.创建目录

mkdir /usr/local/clamav/logs  (日志存放目录)
touch /usr/local/clamav/logs/clamd.log
touch /usr/local/clamav/logs/freshclam.log
mkdir /usr/local/clamav/updata  (clanav 病毒库目录)
chown  -R root.clamav /usr/local/clamav/
chown -R clamav.clamav /usr/local/clamav/updata/
chown clamav.clamav /usr/local/clamav/logs/clamd.log
chown clamav.clamav /usr/local/clamav/logs/freshclam.log

5.配置

cd /usr/local/clamav/etc
cp clamd.conf.sample clamd.conf
cp freshclam.conf.sample freshclam.conf

vi clamd.conf
#Example    注释掉这一行.
LogFile /usr/local/clamav/logs/clamd.log    
PidFile /usr/local/clamav/updata/clamd.pid     
DatabaseDirectory /usr/local/clamav/updata
vi freshclam.conf
#Example    注释掉这一行.  
DatabaseDirectory /usr/local/clamav/updata
UpdateLogFile /usr/local/clamav/logs/freshclam.log
PidFile /usr/local/clamav/updata/freshclam.pid

6.升级病毒库

/usr/local/clamav/bin/freshclam

7.

/usr/local/clamav/bin/clamscan --remove  查杀当前目录并删除感染的文件

8.计划任务
实际生产环境应用
使用计划任务,让服务器每天晚上定时跟新和定时杀毒。保存杀毒日志,我的crontab文件如下

1  3  * **         /usr/local/clamav/bin/freshclam
30 3  * * *          /usr/local/clamav/bin/clamscan  --infected  -r /  --remove -l /var/log/clamscan.log
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值