您好,登錄后才能下訂單哦!
環境:Centos 7.2
軟件:clamav
第一步:Clamav下載
wget http://www.clamav.net/downloads/production/clamav-0.99.2.tar.gz
第二步:創建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
這個過程很久,大概半個小時,等吧。可以開啟screen來進行
/usr/local/clamav/bin/clamscan --remove (查殺當前目錄并刪除感染的文件)
第六步:計劃任務
實際生產環境應用
一般使用計劃任務,讓服務器每天晚上定時跟新和定時殺毒。保存殺毒日志,我的crontab文件如下
yum install crontabs -y /sbin/service crond start //啟動服務 /sbin/service crond stop //關閉服務 /sbin/service crond restart //重啟服務 /sbin/service crond reload //重新載入配置 chkconfig crond on //開機啟動 centos6 systemctl enable crond.service //開機啟動 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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。