Clam AntiVirus(ClamAV)是免费而且开放源代码的防毒软件,软件与病毒码的更新皆由社群免费发布。目前ClamAV主要是使用在Linux、FreeBSD等Unix-like系统架设的邮件服务器上,提供电子邮件的病毒扫描服务.

安装EPEL源

(http://www.cyberciti.biz/faq/installing-rhel-epel-repo-on-centos-redhat-7-x/)

Clamav可以通过EPEL源来安装,所以要首先安装EPEL,可以采用两种方法来安装:

第一种,通过命令行安装

[root@server_for_product ~]# yum install epel-release

第二种,使用下载好的安装包进行安装

[root@server_for_product ~]# cd /tmp

[root@server_for_product tmp]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

ls *.rpm

[root@server_for_product tmp]# yum install epel-release-7.noarch.rpm

刷新安装源并查看是否已经安装

[root@server_for_product ~]# yum repolist

看到以下字样就代表安装完成

epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64

查看EPEL源含有的安装包

[root@server_for_product ~]# yum --disablerepo="*" --enablerepo="epel" list available | less

安装ClamAV

在安装了EPEL源后,运行下面的命令安装ClamAV

[root@server_for_product ~]# yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd -y

在两个配置文件/etc/freshclam.conf和/etc/clamd.d/scan.conf中移除“Example”字符

[root@server_for_product ~]#sed -i -e “s/^Example/#Example/” /etc/freshclam.conf

[root@server_for_product ~]#sed -i -e “s/^Example/#Example/” /etc/clamd.d/scan.conf

手动更新病毒库

[root@server_for_product ~]# freshclam

顺便一提,freshclam命令通过文件/etc/cron.d/clamav-update来自动运行,该文件的内容

## Adjust this line...

MAILTO=root

## It is ok to execute it as root; freshclam drops privileges and becomes

## user 'clamupdate' as soon as possible

0 */3 * * * root /usr/share/clamav/freshclam-sleep

但默认情况下是禁止了自动更新功能,需要移除文件/etc/sysconfig/freshclam最后一行的配置才能启用

## Adjust this line...

MAILTO=root

## It is ok to execute it as root; freshclam drops privileges and becomes

## user 'clamupdate' as soon as possible

0 */3 * * * root /usr/share/clamav/freshclam-sleep

[root@server_for_product kylin]# ^C

[root@server_for_product kylin]# tail /etc/sysconfig/freshclam

## This option accepts two special values:

## 'disabled-warn' ... disables the automatic freshclam update and

## gives out a warning

## 'disabled' ... disables the automatic freshclam silently

# FRESHCLAM_DELAY=

### !!!!! REMOVE ME !!!!!!

### REMOVE ME: By default, the freshclam update is disabled to avoid

### REMOVE ME: network access without prior activation

FRESHCLAM_DELAY=disabled-warn # REMOVE ME

记得移除上面红色字体。

定义服务器类型(本地或者TCP),在这里定义为使用本地socket,将文件/etc/clam.d/scan.conf中的这一行前面的注释符号去掉:

#LocalSocket /var/run/clamd.scan/clamd.sock

配置开机启动

[root@server_for_product ~]# systemctl enable clamd@scan

[root@server_for_product ~]# ln -s ‘/usr/lib/systemd/system/clamd@scan.service’ ‘/etc/systemd/system/multi-user.target.wants/clamd@scan.service’

启动并检查服务状态

[root@server_for_product ~]# systemctl start clamd@scan

[root@server_for_product ~]# systemctl status clamd@scan

看到active字样就表示安装成功。

备注

如果在手动更新病毒库的时候遇到错误:Update failed. Your network may be down or none of the mirrors listed in freshclam.conf is working.

此时就要删除掉旧的镜像地址文件

[root@server_for_product ~]# rm -f /var/lib/clamav/mirrors.dat

再手动更新一次病毒库

[root@server_for_product ~]# freshclam

本文地址:http://www.linuxdiyf.com/linux/18635.html

Centos7安装杀毒软件ClamAV的更多相关文章

  1. ubantu 安装杀毒软件 clamav

    前言: 搜索了一番安装杀毒软件的教程, 但是多有残缺不全的, 所以整理一下,以作记录 1. 添加用户 groupadd clamav useradd -g clamav -s /bin/false - ...

  2. Centos7下杀毒软件clamav的安装和使用

    目录 一.yum安装 二.编译安装 2.1:下载软件包 2.2:创建clamav用户和存放病毒库目录 2.3:解压安装包 2.4:安装依赖 2.5:编译安装 2.6:配置clamav 2.7:启动cl ...

  3. (转)Centos7下杀毒软件clamav的安装和使用

    本文转载自:https://www.cnblogs.com/bingo1024/p/9018212.html#_label1_0 目录 一.yum安装 二.编译安装 2.1:下载软件包 2.2:创建c ...

  4. centos 6.4安装杀毒软件clamAV 0.98[转]

    原文出处: http://dnuser.blog.51cto.com/4863891/1303829   1.查看系统版本 [root@local]# lsb_release -a LSB Versi ...

  5. Linux下杀毒软件clamav的安装和使用

    发表于:2017年6月30日 分类:Linux/Unix   最近发现有台服务器中毒了,手动去查杀总是会有遗漏,最后安装了Linux下的杀毒软件clamav,使用起来还是不错的. 环境:Linux 6 ...

  6. Linux 杀毒软件ClamAV安装部署

    环境说明 系统安全需求,批量安装免费杀毒软件: 操作系统统一为CentOS 7 x64,在此选择免费开源杀毒软件ClamAV: 两种安装方式 1.yum 安装: 2.源码包编译安装: 安装参考网址: ...

  7. linux安装杀软 clamAV

    ClamAV 是Linux平台最受欢迎的杀毒软件,ClamAV 属于免费的开源软件,支持多种平台.ClamAV是基于病毒扫描的命令行工具,但同时也有支持图形界面的ClamTK工具.ClamAV 主要用 ...

  8. HP服务器 hp 360g5 centos7安装问题

    HP服务器  hp 360g5 centos7安装问题 一 :启动盘无法识别硬盘 1.进入安装光盘,用上下键选择安装centos--Install Centos7(注意不可按Enter键),如图: 2 ...

  9. CentOS7 安装Mono及Jexus

    CentOS7安装Mono及Juxes 1 安装Mono 1.1 安装yum-utils 因为安装要用到yum-config-manager,默认是没有安装的,所以要先安装yum-utils包.命令如 ...

随机推荐

  1. 原生JS默认设置默认值的写法

    json=json||{};json.type=json.type||'get';json.data=json.data||{};json.time=json.time||2000;

  2. 转】mysql数据库delete数据时不支持表别名

    原博文出自于: http://www.cnblogs.com/xdp-gacl/p/4012853.html 感谢! 今天在帮同事查看一条删除的SQL语句执行出错的问题 SQL语句如下: 1 DELE ...

  3. esp8266烧写机智云固件方法

    转:http://blog.csdn.net/k7arm/article/details/51925941 =====================以下为我转载的文章================ ...

  4. cisco tftp 备份/恢复

    使用tftp服务器对cisco 3560 配置备份及恢复 Switch#copy running-config tftp:Address or name of remote host []? 192. ...

  5. linux 课后作业

    第一章 第一单元 : 安装linux 系统:已完成 第二单元: 略 第三单元: 1) 要求以root用户登录系统,右击桌面打开终端,查看当前登陆Linux系统所使用的用户名2) 查看哪些用户在系统上工 ...

  6. POJ 1160Post Office

    POJ 1160    Post Office 我不知道优化,我只知道最暴力的方法,O(V^3),居然100ms不到的过了 设DP[i][j][k]表示考虑前i个小镇,放了j个邮局,最后一个邮局的所在 ...

  7. POJ2155Matrix(二维线段树)

    链接http://poj.org/problem?id=2155 题目操作就是说,每次操作可以是编辑某个矩形区域,这个区域的0改为1,1改为0,每次查询只查询某一个点的值是0还是1. 方法:二维线段树 ...

  8. window

  9. C#之数组

    什么是数组?数组是一种数据结构,包含同一个类型的多个元素.数组的声明:int[] myIntArray; 注:声明数组时,方括号 ([]) 必须跟在类型后面,而不是变量名后面.在 C# 中,将方括号放 ...

  10. 【Oracle 函数索引】一次数据库的优化过程

    [问题]表里数据2万条,查询执行时间 818087.38 ms(12分钟). SQL语句如下:select   F1,F2,F3,F4   from t_sms_g_send t   left joi ...