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

Related Articles

How to set up a cron to take MySQL Database Backup daily and remove the older backup files that are older than 10 days?

Login to your Linux server using ssh. Open your crontab using the below command Crontab -e...

How to Enable Plaintext Authentication in Dovecot?

Dovecot is an Open source IMAP or POP3 server used to create light-weight and high-performance...

How to install ISPConfig on Ubuntu 18.04?

This article will help you on how to install ISPConfig on Ubuntu 18.04. ISPConfig is an open...

Do You Provide TUN/TAP On VPS Hosting?

Typically, TUN/TAP is used when you want to utilize VPN services from your VPS. Windows VPS...

How to place an order for Linux VPS hosting?

Step-1: First, select your desired Linux VPS Hosting plan with your desired billing cycle...

  • 0 Users Found This Useful

Was this answer helpful?