Are there viruses in Linux? The answer is yes, the point is that Linux is a very secure system that minimizes risks. However, when you use a Linux server on a network where there are many clients using Windows, it is useful to install ClamAV to remove those viruses.
ClamAV is an open source antivirus engine for detecting Trojans, viruses, malware and other malicious threats. Of course, it is available for the most common Linux distributions including Debian, Ubuntu, and CentOS.
In case you didn’t know, ClamAV is the standard for mail gateway scanning software. Of course, we are talking about the open source area. This tells you how powerful and reliable it is. All this, with a high performance, which assures you that you will not have an unnecessary expense of computer resource.
Let’s install ClamAV on Debian 9.
1. Install ClamAV
Installing ClamAV is really simple because it is available in the main repositories of most Linux distributions.
In case you are using Fedora:
:~$ sudo dnf install clamav
For CentOS 7:
:~$ sudo yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd
To install ClamAV in OpenSuse, just run:
:~$ sudo zypper install clamav
And for Debian and Ubuntu:
:~$ su :~# apt update && sudo apt upgrade :~# apt-get install clamav clamav-daemon
The installation is done.
2. Using ClamAV
Like any antivirus, its effectiveness depends on how often you update your virus definition. So the first step is to update ClamAV.
Next, scan a directory.
:~# clamscan -r /home/angelo
-r option is for recursively search.
In this case, ClamAV doesn’t detect any viruses because I literally don’t have any. It is practically a clean Debian installation.
I got an infected file, let’s see how ClamAV treats it.
As you can see, ClamAV found the infected file. Now, remove it.
:~# clamscan --infected --remove --recursive /home/angelo
The above process is very easy but it is not a good idea if it has to be done frequently. So, initialize the ClamAV daemon to constantly look for threats.
:~# /etc/init.d/clamav-daemon start :~# /etc/init.d/clamav-freshclam start
Finally, you can consult the rest of ClamAV usage using its help. It is important to know other options of use and configuration.
:~# clamav --help
And that’s it for now.
It is important to know how to use ClamAV on Linux because security is an issue that should not be taken lightly. Its installation and use are quite simple but because it is open source it guarantees a correct and frequently updated database.
Please share this post with your friends.