linux杀毒软件ClamAV下载、安装(在线安装、离线安装)
时间:2024-04-21 17:31:27 来源:网络cs 作者:峨乐 栏目:卖家故事 阅读:
阅读本书更多章节>>>>
流程图
下载
ClamAVNet
离线安装脚本
#扫描文件路径scanfile="/home"#分钟 小时 日期 月份 星期几, 例:0 0 * * * 表示每天0时0秒scantime="0 0 * * *"#添加用户组和组成员groupadd clamavuseradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav#执行安装命令rpm -ivh clamav*.rpm#创建日志和病毒库目录mkdir /usr/local/clamavmkdir /usr/local/clamav/logsmkdir /usr/local/clamav/update#创建日志文件touch /usr/local/clamav/logs/clamd.logtouch /usr/local/clamav/logs/freshclam.log#文件授权chown clamav:clamav /usr/local/clamav/logs/clamd.logchown clamav:clamav /usr/local/clamav/logs/freshclam.logchown -R clamav:clamav /usr/local/clamav/update#修改配置文件clamd.confcp -rf /usr/local/etc/clamd.conf.sample /usr/local/etc/clamd.confsed -i '8s|Example|#Example|' /usr/local/etc/clamd.confcat << EOF >> /usr/local/etc/clamd.confDatabaseDirectory /var/lib/clamavEOF#修改配置文件freshclam.confcp -rf /usr/local/etc/freshclam.conf.sample /usr/local/etc/freshclam.confsed -i '8s|Example|#Example|' /usr/local/etc/freshclam.confcat << EOF >> /usr/local/etc/freshclam.confDatabaseOwner clamavDatabaseDirectory /var/lib/clamavScriptedUpdates yesChecks 24#PrivateMirror 127.0.0.1UpdateLogFile /usr/local/clamav/logs/freshclam.logEOFmkdir /var/lib/clamavchown -R clamav:clamav /var/lib/clamav#上传病毒库文件到/var/lib/clamavcp -rf *.cvd /var/lib/clamav#启动服务并开启自启动#systemctl start clamd@scan #systemctl enable clamd@scan#递归扫描home目录,并且记录日志 #clamscan -r -i /home -l /usr/local/clamav/logs/clamd.log#创建定时运行脚本rm -rf /usr/local/bin/timescan.shtouch /usr/local/bin/timescan.shcat << EOF >> /usr/local/bin/timescan.sh#扫描/home目录,扫描日志存入/usr/local/clamav/logs/clamd.logclamscan -r -i /home -l /usr/local/clamav/logs/clamd.logEOF#按需求修改扫描路径sed -i '2s|/home|'$scanfile'|' /usr/local/bin/timescan.sh#删除原有的计划sed -i '/timescan.sh/d' /etc/crontab#添加定时任务sed -i '$a\'"$scantime root sh /usr/local/bin/timescan.sh" /etc/crontab
通过git下载程序和脚本一键安装
git下载地址和文件说明
https://gitcode.net/zengliguang/clamav_offline_install.git
cvd后缀的文件是病毒库
sh后缀文件是脚本
rpm后缀的是杀毒软件离线安装包
下载
git clone https://gitcode.net/zengliguang/clamav_offline_install.git
安装
进入路径
cd clamav_offline_install
执行sh脚本文件,等待完成安装
source clamav_offline_install.sh
安装完成
手动扫描
clamscan
出现下图说明安装并手动扫描成功
‘
’
阅读本书更多章节>>>>本文链接:https://www.kjpai.cn/gushi/2024-04-21/161004.html,文章来源:网络cs,作者:峨乐,版权归作者所有,如需转载请注明来源和作者,否则将追究法律责任!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。