osama.alani

Member
Oct 21, 2012
10
0
1
cPanel Access Level
Root Administrator
hello,
by this command i can scan my server from shell

clamscan --infected --recursive /home/

what is the command to delete virus by clamav for specific domain

and what is the command for the whole domains please ?


Thanks for help
 

24x7server

Well-Known Member
Apr 17, 2013
1,894
91
78
India
cPanel Access Level
Root Administrator
Hello,

To delete the infected files from specific domain, Please try with the following command

/usr/bin/clamscan /home/USERNAME/public_html -ir --remove=yes

And try following command to scan all domains files

/usr/bin/clamscan /home/*/public_html -ir
 

HostingH

Well-Known Member
Jan 13, 2008
125
17
68
cPanel Access Level
Root Administrator
Hello,

Check the permissions/ownership like attributes.

clamscan /home/USERNAME/public_html -ir --remove=yes >> This command scans and cleans the viruses or files.
You can also use Maldet for scanning the account or servers.
 

stdout

Well-Known Member
Apr 10, 2003
189
6
168
Nelspruit, Mpumalanga, South Africa
cPanel Access Level
Root Administrator
Either you aren't root OR the file(s) were deliberately made immutable using chattr.
Have you tried removing removing the immutable flag on the file(s) yet? eg. "chattr -ia filename.ext"

The chattr command does accept the -R (recursive) flag.

-i
A file with the âiâ attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be writ-
ten to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

-a
A file with the âaâ attribute set can only be open in append mode for writing. Only the superuser or a process possessing the
CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello :)

You may want to consider moving or quarantining the files in the future instead of deleting them. This will allow you to review the files, or backup certain aspects of the files if necessary.

Thank you.