您好,登錄后才能下訂單哦!
環(huán)境:Centos 7.2
軟件:clamav
第一步:Clamav下載
wget http://www.clamav.net/downloads/production/clamav-0.99.2.tar.gz
第二步:創(chuàng)建clamav用戶和組
groupadd clamav useradd -g clamav clamav
第三步:編譯安裝
tar xf clamav-0.99.2.tar.gz cd clamav-0.99.2 ./configure --prefix=/usr/local/clamav && make && make install
第四步:配置
mkdir /usr/local/clamav/logs (日志存放目錄) touch /usr/local/clamav/logs/clamd.log touch /usr/local/clamav/logs/freshclam.log mkdir /usr/local/clamav/updata (clanav 病毒庫目錄) chown -R root.clamav /usr/local/clamav/ chown -R clamav.clamav /usr/local/clamav/updata/ chown clamav.clamav /usr/local/clamav/logs/clamd.log chown clamav.clamav /usr/local/clamav/logs/freshclam.log cd /usr/local/clamav/etc cp clamd.conf.sample clamd.conf cp freshclam.conf.sample freshclam.conf vi clamd.conf #Example 注釋掉這一行. LogFile /usr/local/clamav/logs/clamd.log PidFile /usr/local/clamav/updata/clamd.pid DatabaseDirectory /usr/local/clamav/updata vi freshclam.conf #Example 注釋掉這一行. DatabaseDirectory /usr/local/clamav/updata UpdateLogFile /usr/local/clamav/logs/freshclam.log PidFile /usr/local/clamav/updata/freshclam.pid
第五步:升級病毒庫
/usr/local/clamav/bin/freshclam
這個(gè)過程很久,大概半個(gè)小時(shí),等吧。可以開啟screen來進(jìn)行
/usr/local/clamav/bin/clamscan --remove (查殺當(dāng)前目錄并刪除感染的文件)
第六步:計(jì)劃任務(wù)
實(shí)際生產(chǎn)環(huán)境應(yīng)用
一般使用計(jì)劃任務(wù),讓服務(wù)器每天晚上定時(shí)跟新和定時(shí)殺毒。保存殺毒日志,我的crontab文件如下
yum install crontabs -y /sbin/service crond start //啟動(dòng)服務(wù) /sbin/service crond stop //關(guān)閉服務(wù) /sbin/service crond restart //重啟服務(wù) /sbin/service crond reload //重新載入配置 chkconfig crond on //開機(jī)啟動(dòng) centos6 systemctl enable crond.service //開機(jī)啟動(dòng) centos7 crontab -e 1 3 * /usr/local/clamav/bin/freshclam 30 3 * /usr/local/clamav/bin/clamscan --infected -r / --remove -l /var/log/clamscan.log
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。