How to run ClamAV scan from SSH in cPanel server?

In this article, we'll discuss how to run ClamAV scan via SSH in cPanel/WHM server. ClamAV is one of the most popular anti-virus plugin available for cPanel servers. If ClamAV plugin is installed in WHM server, individual cPanel users can also scan their home directory, emails, FTP directory from cPanel itself.

 

  1. Login to your Linux machine via SSH.

  2. Run the following command to scan specific cPanel user's public_html directory. Make sure you replace actual cPanel username with "username" in following command. This command is useful when the specific cPanel account is infected and you want it to scan.

    clamscan -ri /home/username/public_html
    
    The flag -r denotes recursive file checking.
    The flag -i will show only infected files.

    Once scan is finished, you will be given Scan Summary report with list of infected files if any.

  3. To scan the public_html directory of all cPanel accounts, issue following command.

    clamscan -ri /home/*/public_html
  4. To run the clamscan command to all cPanel accounts, issue following command.

    clamscan -ri /home
  5. Issue following command to run the clamscan to remove infected files while scanning public_html directory of all cPanel accounts.

    clamscan -ri –remove /home/*/public_html

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to kill a process on Linux using command?

There might be an issue with applications that can be hung and not working properly. In this...

How to Install Java on Ubuntu 18.04 ?

Java is a programming language developed by Sun Microsystems. There are lots of applications and...

How to Install Tomcat 7 on Centos?

Tomcat is an open-source web server that is built in Java Servlet and JavaServer Pages...

How to install Git on Centos7?

Git is a famous version-control system. Git is used to tracking the changes made on your code as...

How to Install Jenkins on CentOS 7?

Jenkins is an opensource and free tool for developers to develop, test and deploy the code...