Difference between revisions of "ClamAV"

From ArchWiki
Jump to: navigation, search
m (moved Install and configure Antivirus ClamAV to ClamAV: Title is redundant, naming should be basic.)
(Just a stub before, kinda is still but better, better organized, got the basics)
Line 1: Line 1:
[[Category:Networking (English)]]
 
[[Category:HOWTOs (English)]]
 
 
 
{{i18n_links_start}}
 
{{i18n_links_start}}
 
{{i18n_entry|English|Install and configure Antivirus ClamAV}}
 
{{i18n_entry|English|Install and configure Antivirus ClamAV}}
Line 7: Line 4:
 
{{i18n_links_end}}
 
{{i18n_links_end}}
  
==== ClamAV installation====
+
Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX.  It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command line scanner and advanced tool for automatic database updates.  Because ClamAV's main use is on file/mail servers for Windows desktops it primarily detects Windows viruses and malware.
* Grab it<br><pre>pacman -Sy clamav</pre>
+
 
 +
=Install=
 +
 
 +
Install with pacman by:
 +
 
 +
pacman -Sy clamav
 +
 
 +
=Configure=
 +
 
 +
To run as a server edit {{Filename|/etc/clamav/clamd.conf}} and {{Filename|/etc/clamav/freshclam.conf}} and comment out the ''Example'' flag.  In {{Filename|/etc/conf.d/clamav}} change the start options from "no" to "yes".
  
* Configure it
 
*# Edit /etc/clamav/clamd.conf, /etc/clamav/freshclam.conf and comment out the ''Example'' flag
 
*# Edit /etc/conf.d/clamav and change the start options from "no" to "yes"<br>
 
 
<pre># change these to "yes" to start
 
<pre># change these to "yes" to start
 
START_FRESHCLAM="yes"
 
START_FRESHCLAM="yes"
 
START_CLAMD="yes"</pre>
 
START_CLAMD="yes"</pre>
  
* Edit /etc/rc.conf and write clamav into the list of daemons, if you like to start clamav automaticaly when booting.<br><br>
+
* To start clamav at boot edit {{Filename|/etc/rc.conf}} and add clamav.
 +
 
 +
=Update Database=
 +
 
 +
The daemon needs to be running for the virus update to be updated:
 +
 
 +
/etc/rc.d/clamav start
 +
 
 +
Then update the virus definitions with:
 +
 
 +
freshclam
 +
 
 +
=Scan for Viruses=
 +
 
 +
<code>clamscan</code> can be used to scan certain files, home directory, or an entire system:
 +
 
 +
clamscan myfile
 +
clamscan -r -i /home
 +
clamscan -r -i --exclude-dir=^/sys\|^/proc\|^/dev /
 +
 
 +
If you'd like <code>clamscan</code> to remove the infected file use the <code>--remove</code> variable in the command.
 +
 
 +
=Troubleshooting=
 +
 
 +
If you get the following messages after running freshclam:
 +
 
 +
<pre>WARNING: Clamd was NOT notified: Can't connect to clamd through
 +
/var/lib/clamav/clamd.sock connect(): No such file or directory </pre>
  
==== ClamAV errors & solutions ====
+
Add a sock file for clamav
* If you get the following messages after running freshclam:
+
<pre>
+
WARNING: Clamd was NOT notified: Can't connect to clamd through /var/lib/clamav/clamd.sock
+
connect(): No such file or directory
+
</pre>
+
==> Run the following commands as root:<br>
+
<pre>
+
# touch /var/lib/clamav/clamd.sock
+
# chown clamav:clamav /var/lib/clamav/clamd.sock
+
</pre>
+
  
 +
touch /var/lib/clamav/clamd.sock
 +
chown clamav:clamav /var/lib/clamav/clamd.sock
  
* If you get the next error when starting /etc/rc.d/clamav:
+
If you get the next error when starting the daemon:
<pre>
+
<pre>LibClamAV Error: cli_loaddb(): No supported database files found
LibClamAV Error: cli_loaddb(): No supported database files found in /var/lib/clamav
+
in /var/lib/clamav ERROR: Not supported data format</pre>
ERROR: Not supported data format
+
</pre>
+
Run freshclam as root:
==> Just try to run freshclam as root:
+
 
  freshclam -v
 
  freshclam -v

Revision as of 02:12, 9 June 2009

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end

Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX. It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command line scanner and advanced tool for automatic database updates. Because ClamAV's main use is on file/mail servers for Windows desktops it primarily detects Windows viruses and malware.

Install

Install with pacman by:

pacman -Sy clamav

Configure

To run as a server edit Template:Filename and Template:Filename and comment out the Example flag. In Template:Filename change the start options from "no" to "yes".

# change these to "yes" to start
START_FRESHCLAM="yes"
START_CLAMD="yes"

Update Database

The daemon needs to be running for the virus update to be updated:

/etc/rc.d/clamav start

Then update the virus definitions with:

freshclam

Scan for Viruses

clamscan can be used to scan certain files, home directory, or an entire system:

clamscan myfile
clamscan -r -i /home
clamscan -r -i --exclude-dir=^/sys\|^/proc\|^/dev /

If you'd like clamscan to remove the infected file use the --remove variable in the command.

Troubleshooting

If you get the following messages after running freshclam:

WARNING: Clamd was NOT notified: Can't connect to clamd through 
/var/lib/clamav/clamd.sock connect(): No such file or directory 

Add a sock file for clamav

touch /var/lib/clamav/clamd.sock
chown clamav:clamav /var/lib/clamav/clamd.sock

If you get the next error when starting the daemon:

LibClamAV Error: cli_loaddb(): No supported database files found
in /var/lib/clamav ERROR: Not supported data format

Run freshclam as root:

freshclam -v