Clamav

Clamav 杀毒软件安装

1. 下载软件包

#官网地址:
    http://www.clamav.net/downloads   
#Linux中下载地址:
    wget https://www.clamav.net/downloads/production/clamav-0.103.1
.tar.gz
#参考文档:
    https://github.com/vrtadmin/clamav-faq/raw/master/manual/clamdoc.pdf

2. 创建用户和组

[root@oracledb src]# groupadd clamav 
[root@oracledb src]# useradd -g clamav clamav

3. 安装依赖包

//配置仓库
[root@oracledb yum.repos.d]# cat test.repo 
[AppStream]
name=123 
baseurl=file:///mnt 
gpgcheck=0
enabled=1 
[root@oracledb yum.repos.d]# mount /dev/cdrom /mnt

//安装依赖包
yum -y install gcc  gcc-c++ make libcurl-devel

//安装openssl 
[root@oracledb openssl-1.1.1m]# cd /usr/src/
[root@oracledb openssl-1.1.1m]# tar -xf openssl-1.1.1m.tar.gz
[root@oracledb openssl-1.1.1m]# cd openssl-1.1.1m
[root@oracledb openssl-1.1.1m]# ./config --prefix=/usr/local/openssl && make && make install 

echo “/usr/local/openssl/lib” >> /etc/ld.so.conf
ldconfig

4. 解压,编译安装

[root@oracledb src]# cd /usr/src/
[root@oracledb src]# tar -xf clamav-0.103.1.tar.gz
[root@oracledb clamav-0.103.1]# cd clamav-0.103.1
[root@oracledb clamav-0.103.1]# ./configure --prefix=/usr/local/clamav --with-pcre --with-openssl=/usr/local/openssl && make && make install

5. 创建日志,病毒存放目录

//创建日志存放目录
[root@oracledb clamav-0.103.1]# cd /usr/local/clamav/
[root@oracledb clamav]# ls
bin  etc  include  lib64  sbin  share
[root@oracledb clamav]# mkdir logs 
[root@oracledb clamav]# cd logs/
[root@oracledb logs]# touch clamd.log 
[root@oracledb logs]# touch freshclam.log 
[root@oracledb clamav]# chown -R clamav:clamav /usr/local/clamav/logs

//创建病毒存放目录
[root@oracledb clamav]# mkdir updata 
[root@oracledb clamav]# chown -R root.clamav /usr/local/clamav 
[root@oracledb clamav]# chown -R clamav.clamav /usr/local/clamav/updata

6. 配置clamav

[root@oracledb clamav]# cd /usr/local/clamav/etc/ 
[root@oracledb etc]# ls
clamd.conf.sample  freshclam.conf.sample
[root@oracledb etc]# cp clamd.conf.sample clamd.conf 
[root@oracledb etc]# vim clamd.conf
#Example 注释掉这一行
// 添加下列三行 
LogFile /usr/local/clamav/logs/clamd.log
PidFile /usr/local/clamav/updata/clamd.pid
DatabaseDirectory /usr/local/clamav/updata

在这里插入图片描述

[root@oracledb etc]# cp freshclam.conf.sample freshclam.conf
[root@oracledb etc]# vim freshclam.conf
#Example 注释这一行
// 添加这三行
UpdateLogFile /usr/local/clamav/logs/freshclam.log
PidFile /usr/local/clamav/updata/freshclam.pid
DatabaseDirectory /usr/local/clamav/updata

在这里插入图片描述

7. 启动clamav

[root@oracledb etc]# chown -R clamav.clamav /usr/local/clamav 
[root@oracledb etc]# systemctl start clamav-freshclam
[root@oracledb etc]# systemctl status clamav-freshclam.service
● clamav-freshclam.service - ClamAV virus database updater
   Loaded: loaded (/usr/lib/systemd/system/clamav-freshclam.service; enabled; vendor
 preset: disabled)   Active: active (running) since 一 2022-01-10 16:54:53 CST; 1s ago
     Docs: man:freshclam(1)
           man:freshclam.conf(5)
           https://www.clamav.net/documents
 Main PID: 47013 (freshclam)
   CGroup: /system.slice/clamav-freshclam.service
           └─47013 /usr/local/clamav/bin/freshclam -d --foreground=true

110 16:54:53 oracledb systemd[1]: Started ClamAV virus database updater.
110 16:54:53 oracledb freshclam[47013]: ClamAV update process started at Mon...2
110 16:54:53 oracledb freshclam[47013]: WARNING: Your ClamAV installation is...!
110 16:54:53 oracledb freshclam[47013]: WARNING: Local version: 0.103.1 Reco...4
110 16:54:53 oracledb freshclam[47013]: DON'T PANIC! Read https://www.clamav...v
110 16:54:53 oracledb freshclam[47013]: daily database available for downloa...)
Hint: Some lines were ellipsized, use -l to show in full.

8. 更新病毒库

// 下载地址
http://db.cn.clamav.net/daily.cvd 
http://db.cn.clamav.net/main.cvd 
http://db.cn.clamav.net/bytecode.cvd

[root@oracledb updata]# cd /usr/local/clamav/updata
[root@oracledb updata]# ls
bytecode.cvd  daily.cvd  main.cvd

[root@oracledb updata]# /usr/local/clamav/bin/freshclam 
ClamAV update process started at Mon Jan 10 17:24:33 2022
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.103.1 Recommended version: 0.103.4
DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
daily.cvd database is up to date (version: 26417, sigs: 1970392, f-level: 90, builde
r: raynman)main.cvd database is up to date (version: 62, sigs: 6647427, f-level: 90, builder: s
igmgr)bytecode.cvd database is up to date (version: 333, sigs: 92, f-level: 63, builder: a
willia2)

[root@oracledb updata]# systemctl start clamav-freshclam
[root@oracledb updata]# systemctl status clamav-freshclam
● clamav-freshclam.service - ClamAV virus database updater
   Loaded: loaded (/usr/lib/systemd/system/clamav-freshclam.service; enabled; vendor preset: disabled)
   Active: active (running) since 一 2022-01-10 17:25:52 CST; 10s ago
     Docs: man:freshclam(1)
           man:freshclam.conf(5)
           https://www.clamav.net/documents
 Main PID: 48705 (freshclam)
   CGroup: /system.slice/clamav-freshclam.service
           └─48705 /usr/local/clamav/bin/freshclam -d --foreground=true

1月 10 17:25:52 oracledb systemd[1]: Started ClamAV virus database updater.
1月 10 17:25:52 oracledb freshclam[48705]: ClamAV update process started at Mon Jan 10 17:25:52 2022
1月 10 17:25:52 oracledb freshclam[48705]: WARNING: Your ClamAV installation is OUTDATED!
1月 10 17:25:52 oracledb freshclam[48705]: WARNING: Local version: 0.103.1 Recommended version: 0.103.4
1月 10 17:25:52 oracledb freshclam[48705]: DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
110 17:25:52 oracledb freshclam[48705]: daily.cvd database is up to date (version: 26417, sigs: 1970392, f-level: 90, builder: raynman)
110 17:25:52 oracledb freshclam[48705]: main.cvd database is up to date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
110 17:25:52 oracledb freshclam[48705]: bytecode.cvd database is up to date (version: 333, sigs: 92, f-level: 63, builder: awillia2)

9. 扫描杀毒

[root@oracledb updata]# echo export PATH=/usr/local/clamav/bin:$PATH >/etc/profile.d/clamav.sh
d/clamav.sh [root@oracledb updata]# source /etc/profile.d/clamav.sh
[root@oracledb updata]# cl
clamav-config  clamconf       clamscan       clock          
clambc         clamdscan      clear          clockdiff      
[root@oracledb updata]# clamdscan /usr

----------- SCAN SUMMARY -----------
Infected files: 0
Total errors: 1
Time: 0.000 sec (0 m 0 s)
Start Date: 2022:01:10 17:28:31
End Date:   2022:01:10 17:28:31

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值