{"id":7007,"date":"2017-09-12T15:16:55","date_gmt":"2017-09-12T07:16:55","guid":{"rendered":"http:\/\/rmohan.com\/?p=7007"},"modified":"2017-09-12T15:16:55","modified_gmt":"2017-09-12T07:16:55","slug":"basic-clamav-installation-on-centos-7-and-centos-6","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7007","title":{"rendered":"Basic ClamAV installation on CentOS 7 and CentOS 6"},"content":{"rendered":"<p>Basic ClamAV installation on CentOS 7 and CentOS 6<\/p>\n<p>ClamAV is an open source antivirus engine for detecting trojans, viruses, malware &#038; other malicious threats. ClamAV includes a multi-threaded scanner daemon, command line utilities for on demand file scanning and automatic signature updates.<br \/>\nIt is one of the most popular virus scanner that run on CentOS and RedHat and here is very simple quick installation steps.<\/p>\n<p>CentOS 7 Installation<br \/>\n1. ClamAV can easily be installed on CentOS 7.x or RHEL 7.x system to use Fedora EPEL repo. Here is how to add them to you CentOS 7<br \/>\n# wget http:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/epel-release-7-5.noarch.rpm<br \/>\n# rpm -ivh epel-release-7-5.noarch.rpm<br \/>\n2. Install ClamAV and all prerequisites<br \/>\n# yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd<br \/>\n3. Now lets remove Example lines from configuration files.<br \/>\n#sed -i -e &#8220;s\/^Example\/#Example\/&#8221; \/etc\/freshclam.conf<\/p>\n<p>#sed -i -e &#8220;s\/^Example\/#Example\/&#8221; \/etc\/clamd.d\/scan.conf<br \/>\n4. Run ClamAV updates<br \/>\n# freshclam<br \/>\n6. Run your scan.<br \/>\n#clamscan &#8211;infected &#8211;remove &#8211;recursive \/home<br \/>\n7. For testing purposes you can upload test virus and make sure it is detected.<br \/>\n#curl -O http:\/\/www.eicar.org\/download\/eicar.com<br \/>\nclamscan &#8211;infected &#8211;remove &#8211;recursive<br \/>\nCentOS 6 Installation<br \/>\n1. Install EPEL repo for CentOS 6<br \/>\n#wget https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-6.noarch.rpm<br \/>\n#rpm -Uvh epel-release-6*.rpm<br \/>\n2. Install ClamAV<br \/>\n#yum install clamav clamd<br \/>\n3. Start ClamV services and make sure they set to auto start<br \/>\n#clamd on<br \/>\n#chkconfig clamd on<br \/>\n#clamd start<br \/>\nBelow is example of how to run scan against home directory and moving infected files to \/usr\/local\/virusBAD\/<br \/>\n#clamscan -ir \/home -l \/var\/log\/clamscan.log &#8211;move=\/usr\/local\/virusBAD\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Basic ClamAV installation on CentOS 7 and CentOS 6<\/p>\n<p>ClamAV is an open source antivirus engine for detecting trojans, viruses, malware &#038; other malicious threats. ClamAV includes a multi-threaded scanner daemon, command line utilities for on demand file scanning and automatic signature updates. It is one of the most popular virus scanner that run on [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7007"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7007"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7007\/revisions"}],"predecessor-version":[{"id":7008,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7007\/revisions\/7008"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}