Install and use Linux, clamav's anti-virus software

Installation depends:

1
2
3
yum install -y pcre* zlib zlib-devel libssl-devel libssl
yum install -y openssl
yum install -y epel-release

openssl version 0.9.8 or higher

 

 

1. yum install clamav

 

After you install the service will automatically generate a file, start the service, use the command clamdsacn, fast scanning speed.
After starting the service, the connection will scan real-time monitoring, although safe, but might affect server performance.

General Linux 6 and 7, 6 will be able to find some of the components, ignored.

1
yum install clamav  clamav-server clamav-data clamav-update clamav-filesystem clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd

 

 

2. Update the virus database

 

Command to perform the update, download the virus database

1
/usr/bin/freshclam

 

If you can not download, you can come to the local wget.

1
2
3
4
5
cd /usr/share/clamav
wget http: //database .clamav.net /main .cvd
wget http: //database .clamav.net /daily .cvd
wget http: //database .clamav.net /bytecode .cvd
chown clamav:clamav *
 
 
 
3. Virus Scan
 
clamav There are two commands: clamdscan, clamscan
clamdscan command yum install to use for general use, you need to start the clamd service, fast execution speed
clamscan command universal, not dependent services, more command parameters, to perform at a slower pace
 
clamdscan:
With clamdscan scanning, you need to start to use the service. Fast, not with the -r, by default scan subdirectories recursively
 
1
2
service clamd start
clamdscan /usr

 

clamscan:

Clamscan scanning with no need to start the service will be able to use. Slow to bring -r, will scan subdirectories recursively

1
clamscan -r /usr

 

这个命令不仅会显示找到的病毒,正常的扫描文件也会显示出来。

You can use the following command, only to find the virus information

1
2
3
4
clamscan --no-summary -ri /tmp
-r 递归扫描子目录
-i 只显示发现的病毒文件
--no-summary 不显示统计信息

 

You can write a script with the phrase command scans on a regular basis, there is a return value that is to trigger an alarm.

Guess you like

Origin www.cnblogs.com/hftian/p/11711701.html