猴佬大个儿根号二 發表於 2025-5-2 00:00:00

免费开源杀毒软件ClamAV在CentOS安装的教程

<div id="navCategory"><h5 class="catalogue">目录</h5><ul class="first_class_ul"><li><span style="font-family:tahoma,arial,">2、安装</span></li><li><span style="font-family:tahoma,arial,">3、启动服务</span></li><li><span style="font-family:tahoma,arial,">4、更新病毒库</span></li><li><span style="font-family:tahoma,arial,">5、扫描</span></li></ul></div><p style="margin-left:0; margin-right:0">ClamAV是一款由Sourcefire组织开发的开源杀毒引擎,Sourcefire同时也是Snort入侵检测引擎的所有者。ClamAV提供了一种更为快速灵活的框架用以检测恶意代码和软件产品。可以作为现有的台式机、文件服务器、邮件服务器以及其他需要杀毒扫描软件场景中杀毒扫描软件的补充工具或者替代产品。另外ClamAV程序包中还包含了libclamav库以及命令行可执行文件接口。同时也提供了freshclam命令行工具用以保证特征库的更新。<br />Clam AntiVirus(ClamAV)是免费而且开放源代码的防毒软件,软件与病毒码的的更新皆由社群免费发布。目前ClamAV主要是使用在由Linux、FreeBSD等Unix-like系统架设的邮件服务器上,提供电子邮件的病毒扫描服务。ClamAV本身是在文字接口下运作,但也有许多图形接口的前端工具可用,另外由于其开放源代码的特性,在Windows与Mac OS X平台都有其移植版。<br />下面来看一下CentOS上ClamAV的安装:</p>
<h2 style="margin-left:0px; margin-right:0px">1、http://pkgs.repoforge.org/clamav/安装包</h2>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode11" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,"><br />wget http://pkgs.repoforge.org/clamav/clamav-db-0.98.4-1.el6.rf.x86_64.rpm<br />wget http://pkgs.repoforge.org/clamav/clamav-0.98.4-1.el6.rf.x86_64.rpm<br />wget http://pkgs.repoforge.org/clamav/clamd-0.98.4-1.el6.rf.x86_64.rpm</div>
<p class="maodian"></p><h2><span style="font-family:tahoma,arial,">2、安装</span></h2>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode12" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">rpm -ivh clamav-db-0.98-2.el6.rf.x86_64.rpm<br />rpm -ivh clamav-0.98-2.el6.rf.x86_64.rpm<br />rpm -ivh clamd-0.98-2.el6.rf.x86_64.rpm</div>
<p class="maodian"></p><h2><span style="font-family:tahoma,arial,">3、启动服务</span></h2>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode13" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">Service clamd start</div>
<p class="maodian"></p><h2><span style="font-family:tahoma,arial,">4、更新病毒库</span></h2>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode14" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">freshclam</div>
<p class="maodian"></p><h2><span style="font-family:tahoma,arial,">5、扫描</span></h2>
<p><span style="font-family:tahoma,arial,">扫描某个目录,</span></p>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode15" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">clamscan -r /home/oicqzone</div>
<p><span style="font-family:tahoma,arial,">将扫描结果存放到log中,</span></p>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode16" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">clamscan -r /home/oicqzone -l /tmp/clamav.log</div>
<p style="margin-left:0; margin-right:0"></p>
<p style="margin-left:0; margin-right:0">扫描过程中,只显示有问题的文件并且发出警报声音,</p>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode17" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">clamscan -r --bell -i /home/oicqzone</div>
<p><br /><span style="font-family:tahoma,arial,">扫描到有问题的文件,直接删除,</span></p>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode18" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">clamscan -r --remove /home/oicqzone</div>
<p><span style="font-family:tahoma,arial,">,这一步要小心,最好不要这样操作,小心删除系统文件导致系统崩溃</span></p>
<p style="margin-left:0; margin-right:0"></p>
<p style="margin-left:0; margin-right:0">当clamAV扫描完所有文件的时候,会显示如下的类似报告</p>
<p style="margin-left:0; margin-right:0">----------- SCAN SUMMARY -----------&nbsp;&nbsp;<br />Known viruses: 33840&nbsp;&nbsp;<br />Scanned directories: 145&nbsp;&nbsp;<br />Scanned files: 226&nbsp;&nbsp;<br />Infected files: 1&nbsp;&nbsp;<br />Data scanned: 54.22 MB&nbsp;&nbsp;<br />I/O buffer size: 131072 bytes&nbsp;&nbsp;<br />Time: 20.831 sec (0 m 20 s)&nbsp;<br />ClamAV只会去扫描对于ClamAV可以读取的文件。 果您想扫描所有文件,在命令前加上 sudo .</p>
<p style="margin-left:0; margin-right:0">使ClamAV以daemon防护的方式运行</p>
<p style="margin-left:0; margin-right:0">安装clamav-daemon就可以了,clamav-daemon将会建立一个名为&#39;clamav&#39;的帐户,这是为了可以使ClamAV扫描一些系统文件,比如您的Email存放的地方,您可以添加&#39;clamav&#39;为这些文件或者目录的所有者。</p>
<p style="margin-left:0; margin-right:0">如何知道更多的参数</p>
<h2 style="margin-left:0px; margin-right:0px">使用</h2>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode19" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,">man clamscan.</div>
<p style="margin-left:0; margin-right:0"></p>
<p style="margin-left:0; margin-right:0">如何使ClamAV按计划自动运行</p>
<p style="margin-left:0; margin-right:0">您可以使用&#39;at&#39;命令来使clamscan和freshclam运行,比如<br />&nbsp;</p>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode20" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,"><br />at 3:30 tomorrow&nbsp;<br />at&gt;clamscan -i /home/user &gt; mail user@example.com&nbsp;<br />at&gt; &nbsp;<br />job 3 at 2005-04-28 03:30&nbsp;</div>
<p><span style="font-family:tahoma,arial,">或者编辑 /etc/crontab 加入以下内容</span></p>
<div class="msgheader" style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"><p>代码如下:</p></div>
<div class="msgborder" id="phpcode21" style="background:#ddedfb; border-bottom:1px solid #0099cc; border-left:1px solid #0099cc; border-right:1px solid #0099cc; clear:both; font-family:tahoma,arial,"><br />0 3 * * * root /usr/bin/freshclam --quiet -l /var/log/clamav/clamav.log ##每天3点升级</div>
頁: [1]
查看完整版本: 免费开源杀毒软件ClamAV在CentOS安装的教程