ClamAV and Maldet (Linux Malware Detect) are two excellent solutions for identifying malware in the Linux environment. These two software can work together, the advantage being a more efficient and faster malware scan.

To install and configure ClamAV and Maldet (LMD) together on a server managed with cPanel / WHM, we recommend you to follow the steps below:

 

ClamAV installation

  • Log in to WHM as root user
  • Under the cPanel section, select the Manage Plugins option
  • Check the Install and keep updated checkbox next to ClamAV, and then click Save at the bottom of the window. This will start the installation process and may take several minutes. Do not close the web browser until the installation process is complete. After the installation is complete, you will receive a Process Complete message.
  • Log out and log in to WHM again
  • Under the Plugins section, select the Configure ClamAV Scanner option
  • Set global scan permissions. If you want to allow all cPanel users to scan their files, check the Scan Entire Home Directory, Scan Mail, Scan Public FTP Space, and Scan Public Web Space checkboxes. Click Save to save your changes

Maldet installation

  • Log in to your server through the SSH console as a root user
  • Run the following commands to install LMD (Linux Malware Detect):
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

 

Linking together ClamAV and Maldet for the best performance

If you were to run a Linux Malware Detect scan, it could run without any problem. However, this would not include the ClamAV definitions, thus slowing down the scan completion time and threat detection ratio.

To solve this problem, we must create two symbolic links:

ln -s /usr/local/cpanel/3rdparty/bin/clamscan /usr/local/bin/clamscan

ln -s /usr/local/cpanel/3rdparty/bin/freshclam /usr/local/bin/freshclam

 

Run a malware scan

When performing the Maldet scan, this will also include the ClamAV definitions. If you want to run a malware scan of the / home directory, just run the command:
 

maldet -a /home/?

The above command will scan all files and directories in the / home directory, where the content of cPanel accounts is stored.

 

 

For assistance with dedicated servers, please contact us. HostX offers the most stable dedicated servers in Romania and can assist you in solving your problems.

Was this answer helpful? 0 Users Found This Useful (0 Votes)