侧边栏壁纸
  • 累计撰写 49 篇文章
  • 累计创建 29 个标签
  • 累计收到 6 条评论

目 录CONTENT

文章目录

CentOS7 安装 clamAV 杀毒软件

JHL&WWZ
2022-06-27 / 0 评论 / 0 点赞 / 723 阅读 / 895 字 / 正在检测是否收录...

摘要:记录主要源于同事的一个记录,目前原文博主已删除,自己重新记录一下。

还是链接clamAV官网地址一下,虽然看不懂也没找到对应安装文档 https://www.clamav.net/

自动安装clamAv

1.安装clamAV客户端

yum install clamav

执行这一步可能会报一下错误

[root@localhost admin]# yum install clamav
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                                                                                                     | 3.6 kB  00:00:00     
extras                                                                                                                                                                                                   | 2.9 kB  00:00:00     
gitlab_gitlab-ee/x86_64/signature                                                                                                                                                                        |  862 B  00:00:00     
gitlab_gitlab-ee/x86_64/signature                                                                                                                                                                        | 1.0 kB  00:00:00 !!! 
gitlab_gitlab-ee-source/signature                                                                                                                                                                        |  862 B  00:00:00     
gitlab_gitlab-ee-source/signature                                                                                                                                                                        |  951 B  00:00:00 !!! 
updates                                                                                                                                                                                                  | 2.9 kB  00:00:00     
没有可用软件包 clamav。
错误:无须任何处理

遇到这个问题需要先执行另一个命令,及可解决。

yum install -y epel-release
yum install clamav

安装过程中会询问是否同意,输入 y,并按下回车键

依赖关系解决

================================================================================================================================================================================================================================
 Package                                                      架构                                              版本                                                      源                                               大小
================================================================================================================================================================================================================================
正在安装:
 clamav                                                       x86_64                                            0.102.3-1.el7                                             epel                                            444 k
为依赖而安装:
 clamav-filesystem                                            noarch                                            0.102.3-1.el7                                             epel                                             39 k
 clamav-lib                                                   x86_64                                            0.102.3-1.el7                                             epel                                            796 k
 clamav-update                                                x86_64                                            0.102.3-1.el7                                             epel                                            124 k
 libprelude                                                   x86_64                                            5.1.1-1.el7                                               epel                                            308 k

事务概要
================================================================================================================================================================================================================================
安装  1 软件包 (+4 依赖软件包)

总下载量:1.7 M
安装大小:6.3 M
Is this ok [y/d/N]:

查看clamAv版本

clamdscan -V

2.有了客户就可以进行扫描等操作了,如果需要让它作为一个服务在后台运行,还需要安装服务端;

yum install clamav-server-systemd

也是会有询问过程,同样输入 y,并回车

  1. 编辑 /etc/clamd.d/scan.conf 配置文件,将 Example 注释掉,并将 tcp
    端口放开,配置文件中“#”表示注释
vi /etc/clamd.d/scan.conf

注释掉 Example

# Comment or remove the line below.
#Example

取消注释TCPSocket

# TCP port address.
# Default: no
TCPSocket 3310

修改完成后,保存退出

4.更新病毒库,该操作需要连接外网,请先确保网络连接正常;

freshclam

5.启动扫描服务,该操作只在本次有效,重启系统后,该服务将不会启动,开机启动

systemctl start clamd@scan.service

如果无任何报错,则表示成功

6.查看服务运行状态,
下图表示正在运行;

systemctl status clamd@scan.service

运行结果如下

[root@localhost admin]#  systemctl status clamd@scan.service
● clamd@scan.service - clamd scanner (scan) daemon
   Loaded: loaded (/usr/lib/systemd/system/clamd@.service; disabled; vendor preset: disabled)
   Active: active (running) since 日 2020-06-28 08:49:25 CST; 9s ago
     Docs: man:clamd(8)
           man:clamd.conf(5)
           https://www.clamav.net/documents/
  Process: 31288 ExecStart=/usr/sbin/clamd -c /etc/clamd.d/%i.conf (code=exited, status=0/SUCCESS)
 Main PID: 31308 (clamd)
   CGroup: /system.slice/system-clamd.slice/clamd@scan.service
           └─31308 /usr/sbin/clamd -c /etc/clamd.d/scan.conf

6月 28 08:49:22 localhost.localdomain clamd[31308]: ELF support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: Mail files support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: OLE2 support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: PDF support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: SWF support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: HTML support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: XMLDOCS support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: HWP3 support enabled.
6月 28 08:49:22 localhost.localdomain clamd[31308]: Self checking every 600 seconds.
6月 28 08:49:25 localhost.localdomain systemd[1]: Started clamd scanner (scan) daemon.

7.将扫描服务设置为开机启动

systemctl enable clamd@scan.service
0

评论区