apt-get install clamav-daemon clamav-freshclam
systemctl stop clamav-freshclam
sudo freshclam ##手动更新数据库,一般都会更新失败,报超时错误,可以使用 wget 命令把数据库下载下来。
##手动下载 clamva 数据库
cd /var/lib/clamav
wget http://database.clamav.net/main.cvd
wget http://database.clamav.net/daily.cvd
wget http://database.clamav.net/bytecode.cvd
chown -R clamav:clamav *
然后在执行一遍:sudo freshclam
systemctl start clamav-freshclam
/etc/clamav/clamd.conf
LocalSocketGroup root
User root
systemctl start clamav-daemon
curl https://www.eicar.org/download/eicar.com.txt | clamdscan -
stream: Eicar-Test-Signature FOUND
yum install epel-release
yum install clamav-server clamav-data clamav-filesystem clamav-lib clamav-update clamav clamav-devel
cp /etc/freshclam.conf /etc/freshclam.conf.bak
sed -i '/^Example/d' /etc/freshclam.conf
# Run the freshclam as daemon
[Unit]
Description = freshclam scanner
After = network.target
[Service]
Type = forking
ExecStart = /usr/bin/freshclam -d -c 4
Restart = on-failure
PrivateTmp = true
[Install]
WantedBy=multi-user.target
systemctl enable clam-freshclam.service
systemctl start clam-freshclam.service
##手动下载 clamva 数据库
cd /var/lib/clamav
rm -rf main.cvd daily.cvd bytecode.cvd
wget http://database.clamav.net/main.cvd
wget http://database.clamav.net/daily.cvd
wget http://database.clamav.net/bytecode.cvd
chown -R clamupdate:clamupdate *
然后在执行一遍: freshclam
cp /etc/clamd.d/scan.conf /etc/clamd.d/scan.conf.bak
sed -i '/^Example/d' /etc/clamd.d/scan.conf
User root
LocalSocket /var/run/clamd.sock
...
vim /etc/systemd/system/clamd.service
##把 %i 改成 scan.conf
[Unit]
Description = clamd scanner (scan.conf) daemon
Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/
After = syslog.target nss-lookup.target network.target
[Service]
Type = forking
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/scan.conf
# Reload the database
ExecReload=/bin/kill -USR2 $MAINPID
Restart = on-failure
TimeoutStartSec=420
[Install]
WantedBy = multi-user.target
systemctl enable clamd.service --now
curl https://www.eicar.org/download/eicar.com.txt | clamdscan -
stream: Eicar-Test-Signature FOUND
Last modified by 郑杰, 2021-07-07