linux杀毒软件ClamAV的安装使用

Posted omgasw

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux杀毒软件ClamAV的安装使用相关的知识,希望对你有一定的参考价值。

 

1.安装依赖环境

yum install -y zlib openssl-devel
yum groupinstall -y "Development Tools"
apt install -y zlib1g zlib1g.dev openssl vim build-essential libssl-dev  #ubuntu/debian安装

2.安装clamav软件包

wget http://www.clamav.net/downloads/production/clamav-0.101.0.tar.gz
tar zxvf clamav-0.101.0.tar.gz
cd clamav-0.101.0
./configure --prefix=/usr/local/clamav
make && make install

3.修改配置文件

cp /usr/local/clamav/etc/clamd.conf.sample /usr/local/clamav/etc/clamd.conf
sed -i 8s/Example/#Example/g /usr/local/clamav/etc/clamd.conf
echo LogFile /usr/local/clamav/logs/clamd.log >> /usr/local/clamav/etc/clamd.conf
echo PidFile /usr/local/clamav/updata/clamd.pid >> /usr/local/clamav/etc/clamd.conf
echo DatabaseDirectory /usr/local/clamav/updata/clamav >> /usr/local/clamav/etc/clamd.conf
cp /usr/local/clamav/etc/freshclam.conf.sample /usr/local/clamav/etc/freshclam.conf
sed -i 8s/Example/#Example/g /usr/local/clamav/etc/freshclam.conf
echo DatabaseDirectory /usr/local/clamav/updata >> /usr/local/clamav/etc/freshclam.conf
echo UpdateLogFile /usr/local/clamav/logs/freshclam.log >> /usr/local/clamav/etc/freshclam.conf
echo PidFile /usr/local/clamav/updata/freshclam.pid >> /usr/local/clamav/etc/freshclam.conf

4.创建用户

groupadd clamav
useradd -g clamav clamav

5.创建目录文件

mkdir /usr/local/clamav/logs
mkdir /usr/local/clamav/updata
touch /usr/local/clamav/logs/freshclam.log
chown clamav:clamav /usr/local/clamav/logs/freshclam.log
touch /usr/local/clamav/logs/clamd.log
chown clamav:clamav /usr/local/clamav/logs/clamd.log
chown clamav:clamav /usr/local/clamav/updata

6.升级病毒库(需要服务器连通外网)

/usr/local/clamav/bin/freshclam

7.扫描病毒

/usr/local/clamav/bin/clamscan -r --bell -i /

 

以上是关于linux杀毒软件ClamAV的安装使用的主要内容,如果未能解决你的问题,请参考以下文章

clamav Linux下的杀毒软件安装使用文档

Linux下杀毒软件clamav的安装和使用

ClamAV病毒软件的安装和使用

Linux安装杀毒软件(漏洞扫描工具)ClamAV 并配置邮件告警操作指南

Ubuntu Linux平台安装和使用免费反病毒软件ClamAV

Linux系统查毒软件ClamAV (在线安装)