Linux杀毒软件clamav1.3.1离线安装及杀毒

Linux杀毒软件clamav1.3.1离线安装及杀毒

wget https://www.clamav.net/downloads/production/clamav-1.3.1.linux.x86_64.rpm
rpm -ivh --prefix=/usr/local/clamav clamav-1.3.1.linux.x86_64.rpm
groupadd clamav
useradd -g clamav clamav
mkdir -p /usr/local/clamav/logs
mkdir -p /usr/local/clamav/update
touch /usr/local/clamav/logs/clamd.log
touch /usr/local/clamav/logs/freshclam.log
chown clamav:clamav /usr/local/clamav/logs/clamd.log
chown clamav:clamav /usr/local/clamav/logs/freshclam.log
chown clamav:clamav /usr/local/clamav/update
cp /usr/local/clamav/etc/clamd.conf.sample /usr/local/clamav/etc/clamd.conf
cp /usr/local/clamav/etc/freshclam.conf.sample /usr/local/clamav/etc/freshclam.conf

vim /usr/local/clamav/etc/clamd.conf
#Example  //注释掉这一行
#添加以下内容
LogFile /usr/local/clamav/logs/clamd.log
PidFile /usr/local/clamav/update/clamd.pid
DatabaseDirectory /usr/local/clamav/update


vim /usr/local/clamav/etc/freshclam.conf
#Example  //注释掉这一行
#添加以下内容
DatabaseDirectory /usr/local/clamav/update
UpdateLogFile /usr/local/clamav/logs/freshclam.log
PidFile /usr/local/clamav/update/freshclam.pid

cp /usr/local/clamav/etc/*.conf /usr/local/etc/

下载病毒库文件并上传到目录 /usr/local/clamav/update
main.cvd:https://database.clamav.net/main.cvd
daily.cvd:https://database.clamav.net/daily.cvd
bytecode.cvd:https://database.clamav.net/bytecode.cvd
以上3个病毒库文件,直接用LINUX无法WGET到。我通过WIN系用浏览器直接下载的。

放在此目录/usr/local/clamav/update

vim /etc/ld.so.conf
追加一行:
/usr/local/clamav/lib64


ldconfig

ln -s /usr/local/clamav/bin/clamscan /usr/local/bin/clamscan
#设置软连接

clamscan -r 当前路径杀毒

clamscan -r --bell -i 路径 杀毒

clamscan -r –remove 路径 扫描并清除

clamscan -r --bell -i /opt/1/ --move /tmp/ 扫描并移动病毒和感染文件到指定目录

-r 递归扫描子目录
-i 筛选感染文件
–bell 病毒检测的侦查
–copy 目录 将受感染的文件复制到目录


/usr/local/clamav/bin/clamscan -r / --remove -l /var/log/clamscan.log
LINUX全盘杀毒

/usr/local/clamav/bin/clamscan -r /home --remove -l /var/log/clamscan.log
LINUX的HOME目录杀毒

#让服务器每天晚上定时更新和杀毒,保存杀毒日志,crontab-e文件如下:
1 3 * * * /usr/local/clamav/bin/freshclam --quiet
20 3 * * * /usr/local/clamav/bin/clamscan -r /home --remove -l /var/log/clamscan.log

 

posted @ 2024-08-07 10:23  昵称昵称昵称  阅读(294)  评论(0编辑  收藏  举报