ClamAV for Linux is a free and open-source virus scanner that is operated via the command line. Here we will see the process of installing ClamAV (Clam AntiVirus) on Rocky Linux 8 or AlmaLinux 8.
ClamAV anti-virus engine scanner clamd (ClamAV daemon) service can be started in the background to receive calls (for virus scanning) from other programs. This antivirus mainly uses as a server-side virus scanner on mail servers. ClamAV offers a Command-line scanner, a Milter interface for Sendmail, an Advanced database updater, and built-in support for archive formats, ELF executables + Portable Executable files, and popular document formats. Hence, it is using for various purposes such as email scanning, web scanning, and endpoint security.
Why a virus scanner for Linux?
As compared to Windows, malware in Linux is generally not much lethal, that’s why Virus scanners are not necessary for Linux operating systems. Therefore, ClamAV is very suitable for heterogeneous environments where both Linux and Windows platforms use together in which files downloaded on Linux transfer to Windows, hence this must be checked and scanned before being passed on. For example, checking mail attachments or for use in combination with third-party programs such as Samba or a mail server.
Clam AntiVirus (ClamAV) installation on Rocky Linux or AlmaLinux 8
1. Install EPEL Repository
Packages to install Clamv are not available in the Rocky Linux base repo to install. However, we can get them from the EPEL repo (Extra packages for Enterprise Linux). Hence, add that first.
sudo dnf install epel-release -y
2. Run system update
After adding the EPEL repo, run once the system update command that will refresh the system repository cache and let it know about the packages available in the added repository to install.
sudo dnf update -y 3. Install ClamAV on Rocky Linux 8 or AlmaLinux
Now, we can easily download and install ClamAV including its service “clamd” to run antivirus in the background and Antivirus updater. Just run the following command: sudo dnf install clamav clamd clamav-update
Install ClamAV on Rocky Linux 8 and AlmaLinux 4. Add ClamAV user on Rocky Linux or AlmaLinux
sudo groupadd clamav
sudo useradd -g clamav -s /bin/false -c “Clam Antivirus” clamav
5. Set SELinux for ClamAV
There would be some restriction on some files by SElinux if it has been enabled on our system. Hence, run the below command to configure it for ClamAV. sudo setsebool -P antivirus_can_scan_system 1 5. Run ClamAV database update command
Before configuring this antivirus further, let’s first run its Virus database signature update command: sudo freshcalm
Download latest Signature for ClamAV
6. Enable LocalSocket
If you are setting up a simple, local clamd instance then enable the LocalSocket option in its scan configuration file. sudo sed -i ‘s/#LocalSocket /run/LocalSocket /run/g’ /etc/clamd.d/scan.conf
- ClamAV is a virus scanner for Rocky Linux 8 that can be installed
- Check all news and articles from the latest Security news updates.