Hostwinds Tutorials

Search results for:


Table of Contents


How Do I Scan My Linux Server for Viruses?
How to Run a Virus Scan in Linux Using ClamAV
CentOS
Ubuntu
How to Run a Virus Scan in Linux Using Linux Malware Detect

Running a Virus Scan on your Server

Tags: VPS,  Security 

How Do I Scan My Linux Server for Viruses?
How to Run a Virus Scan in Linux Using ClamAV
CentOS
Ubuntu
How to Run a Virus Scan in Linux Using Linux Malware Detect

How Do I Scan My Linux Server for Viruses?

You can run a Virus scan using ClamAV in a Linux-based environment, 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.

How to Run a Virus Scan in Linux Using ClamAV

The following steps will assist you with the installation of ClamAV for CentOS and Ubuntu. 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)
yum install -y epel-release
yum install -y clamav
freshclam

Ubuntu

  1. Connect to the server instance using an ssh client, such as Putty
  2. Once connected, run the following commands (Please note if you're not running these commands as the root user, you'll need to append the word "sudo" before each command)
apt-get update
apt-get install clamav clamav-daemon
freshclam

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 all users home directories, issue the following command:

clamscan -r /home

To check all files on the server instance:

clamscan -r /

How to Run a Virus Scan in Linux Using Linux Malware Detect

The following steps will assist you with installing Linux Malware Detect for CentOS, Ubuntu, and servers 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
maldet --update

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 /

Written by Michael Brower  /  December 13, 2016