Admin... by accident!

You may have chosen to be an admin. I didn't!

  • Home
  • FreeBSD
  • GNU/Linux
  • Security
  • Virtualization
  • Politics
  • Legal
  • Me

How to install the Clamav antivirus in FreeBSD

April 25, 2017 by Albert Valbuena

Clamav is an antivirus. But don’t think of Clamav as the antivirus you have sitting in your personal computer at home or in your office. It’s an antivirus that works under user demand. It is not constantly monitoring the system. So you will have to setup some cronjobs in order to check and monitor the files and directories under your concern.

sudo pkg install clamav

sudo vi /etc/rc.conf

clamav_clamd_enable=”YES”
clamav_freshclam_enable=”YES”

To enable it’s functionality without rebooting you must type the following commands in this order:

sudo service clamav-freshclam onestart

As root type the following in order to download the latest registration of viruses.

/usr/local/bin/freshclam

Once the virus database is up to date you may now start the clamd service as:

sudo service clamav-clamd onestart

The notification says it has downloaded the files and updated the database but clamd was not notified in a socket. The question is if this is natural. If you first try to start the clamd service it will complain about not having run freshclam first.

Just as a precaution we will run freshclam again.

Now you can scan some folder in order to test the tool or you can scan the whole computer/server by typing the command “clamscan”.

[user@server ~]$ clamscan -rv Files
Scanning Files/default.vcl
Files/default.vcl: OK
Scanning Files/httpd-vhosts.conf
Files/httpd-vhosts.conf: OK
………..
Scanning Files/280_mod_security.conf
Files/280_mod_security.conf: OK
Scanning Files/030_php-fpm.conf
Files/030_php-fpm.conf: OK
Scanning Files/httpd.conf
Files/httpd.conf: OK
Scanning Files/modsecurity.conf
Files/modsecurity.conf: OK
Scanning Files/rc.conf
Files/rc.conf: OK
———– SCAN SUMMARY ———–
Known viruses: 6477933
Engine version: 0.100.0
Scanned directories: 4
Scanned files: 17
Infected files: 0
Data scanned: 0.05 MB
Data read: 0.03 MB (ratio 1.86:1)
Time: 28.754 sec (0 m 28 s)
[user@server ~]$

If you happen to be willing to add mail functionality to your server Clamav also has a binary which is useful in that purpose. The port in FreeBSD is called clamav-milter.

Filed Under: How To's, Security

Recent Posts

  • Abandon Linux. Rolling back the entire OS is possible.
  • A brief introduction to Regular Expressions
  • How to install the bash shell on FreeBSD
  • How to upgrade FreeBSD from version 11.2 up to 12.0
  • How to connect a FreeBSD box to the internet through an Android device via an USB port
  • How to use Fail2ban with WordPress
  • How to install Fail2ban on FreeBSD
  • How to patch Spectre and Meltdown the ROM way
  • How to mitigate Spectre and Meltdown on an HP Proliant server with FreeBSD
  • How to mitigate Spectre and Meltdown on a Lenovo T430s with FreeBSD
  • How to mitigate Spectre and Meltdown on an HP Proliant server with Ubuntu
  • How to mitigate Spectre and Meltdown on a Lenovo T430s laptop with Ubuntu

Archives

  • February 2019
  • January 2019
  • September 2018
  • June 2018
  • May 2018
  • April 2018
  • February 2018
  • January 2018
  • November 2017
  • April 2017

Copyright © 2019 · Magazine Pro Theme on Genesis Framework · WordPress · Log in