您当前的位置:首页 > 计算机 > 系统应用 > Linux

Centos Linux 安装杀病毒扫描软件 clamAV

时间:06-28来源:作者:点击数:

clamAV安装脚本

#!/bin/bash
echo "install ClamAV"
yum -y update
yum -y install wget

# https://www.clamav.net/downloads 根据需求换新版本下载地址
#下载 clamAV
wget -U NoSuchBrowser/1.0 https://www.clamav.net/downloads/production/clamav-0.104.1.linux.x86_64.rpm
yum -y install clamav-0.104.1.linux.x86_64.rpm

#配置用户、权限
groupadd clamav
useradd -g clamav -s /bin/false -c "Clam Antivirus" clamav

sudo chown -R clamav /usr/local/share/clamav

#配置文件生成、初始化
clamconf -g clamd.conf > /usr/local/etc/clamd.conf
clamconf -g freshclam.conf > /usr/local/etc/freshclam.conf
clamconf -g clamav-milter.conf > /usr/local/etc/clamav-milter.conf

#修改配置文件
sed -i 's/^Example.*$/#Example/g' /usr/local/etc/clamd.conf
sed -i 's/^Example.*$/#Example/g' /usr/local/etc/freshclam.conf
sed -i 's/^Example.*$/#Example/g' /usr/local/etc/clamav-milter.conf

sed -i 's/^#DatabaseMirror.*$/DatabaseMirror db.cn.clamav.net/g' /usr/local/etc/freshclam.conf

freshclam

#配置自动更新
freshclam -d
echo '/usr/bin/freshclam -d' >> /etc/rc.local

#测试扫描
clamscan -rzi --quiet -l /tmp/clamscan_$(date +%s).log /boot

#清除缓存
rm -f clamav-0.104.1.linux.x86_64.rpm
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门