How to Virus Scan On Your Server

How To Run A Virus Scan In Linux Using ClamAV

In a Linux based environment, you can run a Virus scan using ClamAV, and you can scan for Malware using Linux Malware Detect. You can also use the ClamAV scan engine with Linux Malware Detect for better performance.
The following steps will assist you with the installation of ClamAV for CentOS. Please note that you may utilize the steps provided for CentOS on a server that is utilizing cPanel.

CentOS

  1. Connect to the server instance using an SSH client, such as Putty.
  2. Once connected, run the following commands as the root user (Please note if you’re not running these commands as the root user you’ll need to append the word “sudo” before each command) 
1
yum install -y epel-release

Once ClamAV is installed you can run a scan using the following commands. Please note that the following commands apply to both Ubuntu and CentOS.

To check files in the all users home directories issue the following command:

 To check all files on the server instance:

 

How To Run A Virus Scan In Linux Using Linux Malware Detect

The following steps will assist you with the installation of Linux Malware Detect for CentOS, Ubuntu, and servers that are utilizing cPanel.

 

  1. Connect to the server instance using an ssh client, such as Putty
  2. Once connected, run the following command (Please note if you’re not running these commands as the root user you’ll need to append the word “sudo” before each command)

cd /usr/local/src/
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar
-xzf maldetect-current.tar.gz
cd
maldetect-*
sh
./install.sh or sudo sh ./install.sh
maldet
--update-ver

To scan an entire directory using Linux Malware Detect, you’d type the following:

maldet -a /home

To scan an entire user directory using Linux Malware Detect, you’d type the following, replacing “username” with the actual username:   maldet -a

/home/username

To scan the entire server instance using Linux Malware Detect, you’d issue the following command:

maldet -a /
Was this answer helpful?