Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Support > Guides & Solutions (No Questions)

Guides & Solutions (No Questions) Post your guides here. You can also add your comments to a guide, but don't start a thread to ask a question. Use another forum for that.


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2009-10-03, 02:41 PM CDT
dbcooper Offline
Registered User
 
Join Date: Oct 2009
Posts: 1
linuxfedorafirefox
ClamAV on Fedora 11

This little guide walks you through getting ClamAV and ClamAV-Update (freshclam) installed and configured
on your Fedora installation with basic/default configurations.

Hopefully, it will help those looking to get started with ClamAV.

----------------------------------

Installation:

Code:
shell> sudo yum install -y clamav clamav-update
----------------------------------

Setup clamav-update:

Code:
shell> sudo vi /etc/freshclam.conf
Note: Change the following 2 items, then save and quit.

Example
to
#Example

#DatabaseDirectory /var/lib/clamav
to
DatabaseDirectory /var/lib/clamav

----------------------------------

In order for the freshclam cron script to work, we'll need to update /etc/sysconfig/freshclam

Code:
shell> sudo vi /etc/sysconfig/freshclam
Note: Change the following item, then save and quit.

FRESHCLAM_DELAY=disabled-warn
to
#FRESHCLAM_DELAY=disabled-warn

----------------------------------

Run the virus definition updates by hand (for testing):

Code:
shell> sudo /usr/bin/freshclam
Run a test scan on /sbin and /bin (recursively and log to /tmp/clamscan.Month-Day-Year.log):

Code:
shell> sudo clamscan -r /sbin /bin --log=/tmp/clamscan.`date +%m-%d-%y`.log
----------------------------------

Script for auto-scans:

Note: Create the script and save under "root's" home.

Code:
shell> sudo su -
shell> cd ~
shell> vi virus-scan.sh
NOTE: Copy and paste the below info into the virus-scan.sh, then save and quit.

Code:
#!/bin/sh
#######################
# Create the log file if needed
#
CLAM_LOG="/var/log/clamscan.log"
if [ ! -f "$CLAM_LOG" ]; then
touch "$CLAM_LOG"
chmod 644 "$CLAM_LOG"
chown clamav.clamav "$CLAM_LOG"
fi
#
########################
# Setup our common scanned paths - note these are based on my systems $PATH
# You can change the user that gets mailed, or don't use mail at all, if using a logging setup etc.
#
COMMON_DIRS="/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin /usr/kerberos/bin /usr/kerberos/sbin /usr/lib/qt* /home /tmp"
#
########################
# Start the scan and mail to root (change as needed)
#
/usr/bin/clamscan -ri $COMMON_DIRS --log="$CLAM_LOG" | mail -s virus-scan.`date +%m-%d-%y` root@localhost
#
########################

Set the script to be executable and test:

Code:
shell> chmod +x virus-scan.sh
shell> ./virus-scan-sh &
Once it's complete check roots mail and/or the log file, if all is well, let's set up a cron job.

----------------------------------

There are many ways to use cron, this example is using the /etc/cron.d structure.

Code:
shell> cd /etc/cron.d
shell> vi virus-scan
NOTE: Copy and paste the following into the virus-scan file, the save and quit.

Code:
# The following will run our script at 2am every day of the week.
# Obviously you'll need to adjust this based on workload, uptimes etc.
00 02 * * * root /root/virus-scan.sh > /dev/null 2>&1
----------------------------------

HTH

Last edited by dbcooper; 2009-10-03 at 02:45 PM CDT.
Reply With Quote
  #2  
Old 2009-10-08, 12:53 PM CDT
Dangermouse's Avatar
Dangermouse Offline
Administrator
 
Join Date: Aug 2007
Location: London Postbox (the red one)
Age: 44
Posts: 2,868
linuxfedorafirefox
Hers a little script to also add right click scan for viruses for those interested.
Quote:
cd /home/$(logname)/.gnome2/nautilus-scripts
yum -y install wget
wget http://dnmouse.org/downloads/scan_for_viruses
chmod +x scan_for_viruses
Dave
__________________
Autoten to help set up fedora (codecs extra software etc..)
My Fedora Guides

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Dependency: clamav-data = 0.87.1-1.fc4 is needed by package clamav-update fire-fly Software 5 2006-01-17 05:17 PM CST
Clamav, clamav-milter, Sendmail kafsar General Support 5 2005-02-28 07:29 AM CST
RE: Suggestions ClamAV on Fedora Ow Mun Heng gmane.linux.redhat.fedora.general 1 2004-06-14 04:04 AM CDT
ClamAV on Fedora Ron Goulard gmane.linux.redhat.fedora.general 9 2004-06-14 04:03 AM CDT
Documenting ClamAV on Fedora? Ron Goulard gmane.linux.redhat.fedora.general 17 2004-06-14 04:02 AM CDT

Translations (Powered by Powered by Google):
Afrikaans Albanian Arabic Belarusian Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Taiwanese Thai Turkish Ukrainian Vietnamese Yiddish

All times are GMT -7. The time now is 06:32 PM CDT.

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo



All trademarks, and forum posts in this site are property of their respective owner(s).

FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Rules | Archive | Contact | Founding Members
Designed By Ewdison Then | Powered by vBulletin ©2000-2010, Jelsoft Enterprises Ltd.
FedoraForum is Powered by Open Source Projects and Products
vB Enterprise Translator (vBET 2.3.10) made by NLP-er