I. Overview
Linux is more secure and more stable than other operating systems. Theoretically, Linux could be harmed by viruses. But it is virtually impossible for Linux machines to be attacked by viruses. So my question here is why to prepare anti-virus software for Linux, in order to better understand, I have prepared the following reasons, Linux platform to install antivirus software reasons: 1, from the Linux platform scan Windows driver. 2. Scan Windows workstation over the network. 3. Scan incoming and outgoing messages in Linux servers. 4, scan sent to other machines important documents.
Below to recommend you the best free Linux platform antivirus software: 1, ClamAV Antivirus. 2, Avast Linux Home Edition. 3, Avast Linux Home Edition. 4, AVG free version antivirus. 5, F-prot Antivirus.
We mainly introduce ClamAV antivirus: ClamAV Antivirus is the most popular anti-virus software Linux platform, ClamAV belongs to free open source products, support a variety of platforms, such as: Linux/unix, MAC OS X, Windows, OpenVMS. ClamAV is a command line tool based on virus scanning, but it also has CLAMTK tools that support graphical interfaces. ClamAV is primarily used by mail servers to scan messages. It has multiple interfaces to scan messages from the mail server, supporting file formats like ZIP, RAR, TAR, GZIP, BZIP2, HTML, DOC, PDF, SIS CHM, RTF, and more. ClamAV has an automatic database update and can also run from a shared library.
Compile ClamAV should include a zlib library for compressing and decompressing functions. (The following is the compilation and use of clamav-0.97.6.tar.gz as an example)
Second, the system environment
System Environment: CentOS 6.2
Software:
1, zlib-1.2.7.tar.gz
Download: wget http://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.7/zlib-1.2.7.tar.gz
2, clamav-0.97.6.tar.gz
Download: wget http://nchc.dl.sourceforge.net/project/clamav/clamav/0.97.6/clamav-0.97.6.tar.gz
Third, installation
1, zlib-1.2.7.tar.gz Installation
Tar xvzf zlib-1.2.7.tar.gz
#cd zlib-1.2.7
#./configure
#make && make install
2. Add user groups ClamAV and group members ClamAV (note: You must add users before installing clamav-0.97.6.tar.gz)
# Groupadd ClamAV
# useradd-g clamav-s/bin/false-c "Clam AntiVirus" ClamAV
3, clamav-0.97.6.tar.gz
#tar Xvzf clamav-0.97.6.tar.gz
#cd clamav-0.97.6
#/configure--prefix=/opt/clamav --disable-clamav
# make
#make Install
Four, configuration
1, create a directory
Mkdir/opt/clamav/logs (log storage directory)
mkdir/opt/clamav/updata (clanav Virus Library directory)
2, create the file
Add two logs files in the/var/log directory: Clamd.log and Freshclam.log, change the owner to a new ClamAV user, and set the appropriate file read and write permissions
#touch/opt/clamav/logs/freshclam.log
#touch/opt/clamav/logs/clamd.log
3. Configure/etc/clam.conf Files
#cd/opt/clamav
#vi etc/clam.conf
# Example comment out this line. Line 8th
Logfile/opt/clamav/logs/clamd.log Delete the previous comment directory to logs the 14th line below
Pidfile/opt/clamav/updata/clamd.pid Delete the previous annotation path and change the 57th line.
Databasedirectory/opt/clamav/updata Ditto Line 65th
4. Configure freshclam.conf Files
#vi etc/freshclam.conf
#Example comment out this line
Databasedirectory/opt/clamav/updata
Updatelogfile/opt/clamav/logs/freshclam.log
Pidfile/opt/clamav/updata/freshclam.pid
5. File authorization
#chown clamav:clamav/opt/clamav/logs/freshclam.log
#chown clamav:clamav/opt/clamav/logs/clamd.log
#chown Clamav:clamav/opt/clamav/updata
V. Implementation
1. Upgrade
#/opt/clamav/bin/freshclam (upgrade virus library) to ensure that your Linux can be normal online oh.
2, antivirus
#/opt/clamav/bin/clamscan --killing files in the current directory
#/opt/clamav/bin/clamscan-r
#/opt/clamav/bin/clamscan dir
#/opt/clamav/bin/clamscan-r Dir--All files and directories under the directory dir
3. Help
#/opt/clamav/bin/clamscan--help
VI. Automatic Update
Automatic Updates for Freshclam
Background run Freshclam:
# freshclam-d
You can also use cron background auto timer to run Freshclam: Add the following line to Crontab:
N * * * * */opt/bin/freshclam--quiet
(of which, N is the data between 3-57, which means that every n hours to check the update virus database) General use of scheduled tasks, so that the server every night with new and timely anti-virus. Save antivirus log, my crontab file is as follows
1 3 * * */usr/local/clamav/bin/freshclam--quiet
3 * * * */usr/local/clamav/bin/clamscan-r/home--remove-l/var/log/clamscan.log
End remember what should be remembered, forget what should be forgotten, change what can be changed, accept what cannot be changed!