首先安装clamav
yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd -y
sed -i 's/^Example/#Example/g' /etc/freshclam.conf #必须关闭Example 否则启动会失败
sed -i 's/^Example/#Example/g' /etc/clamd.d/scan.conf
systemctl enable clamd@scan
ln -s /usr/lib/systemd/system/[email protected] /etc/systemd/system/multi-user.target.wants/[email protected]
修改配置
cat /etc/clamd.d/scan.conf |grep -v "#"|grep -v "^$"
LogSyslog yes
LocalSocket /var/run/clamd.scan/clamd.sock #使用本地socket
TCPAddr 0.0.0.0 #监听地址
User clamscan
AllowSupplementaryGroups yes
更新病毒库
/usr/bin/freshclam
启动
systemctl start clamd@scan
systemctl status clamd@scan
##注意:被检测的机器必须安装并启动clamd@scan 3310端口正常 才能被下面例子中的脚本检测
安装