groupadd clamav && useradd -g clamav clamav && id clamav
mkdir -p /henan/clamav/logs
touch /henan/clamav/logs/clamd.log
touch /henan/clamav/logs/freshclam.log
chown clamav.clamav /henan/clamav/logs/clamd.log
chown clamav.clamav /henan/clamav/logs/freshclam.log
mkdir -p /henan/clamav/updata
chown -R root.clamav /henan/clamav/
chown -R clamav.clamav /henan/clamav/updata/
tar -zxvf clamav-0.103.7.tar.gz
yum -y install gcc
yum -y install gcc-c++
yum -y install openssl-devel
yum -y install libcurl-devel
yum -y install e2fsprogs-devel
./configure --prefix=/henan/clamav --disable-clamav --with-pcre
make && make install
cd /henan/clamav/etc
cp clamd.conf.sample clamd.conf
cp freshclam.conf.sample freshclam.conf
vim clamd.conf
#Example 注释掉这一行.
添加下面三行:
LogFile /henan/clamav/logs/clamd.log
PidFile /henan/clamav/updata/clamd.pid
DatabaseDirectory /henan/clamav/updata
vim freshclam.conf
#Example 注释掉这一行.
添加下面三行
DatabaseDirectory /henan/clamav/updata
UpdateLogFile /henan/clamav/logs/freshclam.log
PidFile /henan/clamav/updata/freshclam.pid
chown -R clamav.clamav /henan/clamav/
systemctl start clamav-freshclam.service
此时你会发现,若系统联网,clamav会自动下载病毒库
main.cvd 下载链接
daily.cvd 下载链接
bytecode.cvd 下载链接
下载完成后,上传至/henan/clamav/update目录下
并执行如下命令
clamdscan --reload。它会通知clamd去重新加载病毒库。
在守护进程关闭的情况下,运行如下命令进行扫描
/henan/clamav/bin/clamscan -r /henan/pack/
clamdscan --version,查看版本信息。
运行如下命令更新病毒库:
systemctl stop clamav-freshclam #关闭守护进程
/usr/local/clamav/bin/freshclam #