[ Prev ] [ Index ] [ Next ]

clamav

Created søndag 04 december 2016


Installation

$ pacman -S clamav


Update

# Update the virus definitions after installation
# NOTE! This must be done the first time, BEFORE enabling the service.
$ freshclam


# Enable clam update service, so clamav will always have the latest virus definitions
$ systemctl enable clamav-freshclam.service


# Enable the daemon. Note that this has bugged before. Make sure freshclam has been run.
$ systemctl enable clamav-daemon.service


Additional virus definition/databases

# Install some un-official virus definitions as well
$ yaourt -S clamav-unofficial-sigs


Test clamav

# Make sure your clamav and its definitions are installed correct (harmless file)
$ curl http://www.eicar.org/download/eicar.com.txt | clamscan -


# The output must include

stdin: Eicar-Test-Signature FOUND



Usage

# Scan a file
$ clamscan <FILE_NAME>


# Scan a directory
$ clamscan -r -i /path/to/folder


# Scan entire system
$ clamscan -r -i --exclude-dir='^/sys|^/dev' /



Troubleshoot

# Lord know there's been a few..


Clamd was not notified on freshclam

# When I tried to run freshclam it failed. The following should be the solution.
# Add a sock file for clamd
$ touch /var/lib/clamav/clamd.sock
$ chown clamav:clamav /var/lib/clamav/clamd.sock


# Then Edit /etc/clamav/clamd.conf and uncomment the following line

LocalSocket /var/lib/clamav/clamd.sock