ClamAV: Can't access file

Ah oke.. yes.. well... :)

Try this, but use at your own risk!!!!
It depends on the amount of disk space you have, so you can lower it, I will write how.
You have to do this as root. Explanation is for RHEL and deratives. With Debian and deratives you might need to use the sudo command in front of the commands.

# Check disk space
df -h

# Check if there is already swap active
swapon --show

# Create 4 GB swap file
cd /
sudo dd if=/dev/zero of=/swapfile bs=1G count=4
if you have little disk space and only want a 2 gb swap space, change the count=4 to count=2

# Set the correct permission
chmod 600 /swapfile

# Setup and activate swapfile
mkswap /swapfile
swapon /swapfile

# Make changes permanent
echo /swapfile swap swap defaults 0 0 >> /etc/fstab
or edit the /etc/fstab file and add this line:
/swapfile swap swap defaults 0 0

# Doublecheck if it's working now
swapon --show
free

Reboot vps/server and check again with the free or swapon --show command.

Good luck. :)
 
Ah oke.. yes.. well... :)

Try this, but use at your own risk!!!!
It depends on the amount of disk space you have, so you can lower it, I will write how.
You have to do this as root. Explanation is for RHEL and deratives. With Debian and deratives you might need to use the sudo command in front of the commands.

# Check disk space
df -h

# Create 4 GB swap file
cd /
sudo dd if=/dev/zero of=/swapfile bs=1G count=4
if you have little disk space and only want a 2 gb swap space, change the count=4 to count=2

# Set the correct permission
chmod 600 /swapfile

# Setup and activate swapfile
mkswap /swapfile
swapon /swapfile

# Make changes permanent
echo /swapfile swap swap defaults 0 0 >> /etc/fstab
or edit the /etc/fstab file and add this line:
/swapfile swap swap defaults 0 0

# Doublecheck if it's working now
swapon — show
free

Good luck. :)
Hi thank you so so much....

Just 1 important question before I do anything have 200 gb backup... but uhm sorry to sound this dumb... how do I make a backup hehe (140gb left of space)
 
how do I make a backup
Ehmz... a backup of what? Doesn't Versio have a snapshot option for VPS systems? I would use that.
I don't know how to do that manually.

You could use the admin backup/transfer to make a backup of all accounts to that backup space. And then the system backup option for system backup.

But I presume Versio also has some safe mode stuff? You can't really break things with this. Only thing which could happen (worst case) is that the VPS won't start anymore. In that case start in safe modem or KVM, remove the swap line from /etc/fstab and reboot vps again and you're done.

However, since this is only swap, I think (80%sure) that the only think which can happen is that it will throw an error that swap is not working.

You can check however, after you used the swapon /swapfile command then check with the check commands on the bottom.
If none of the commands give any error, then there is no reason to expect issues.

But I always tell people to use custom changes on their own risk anyway. :)
 
Ah oke.. yes.. well... :)

Try this, but use at your own risk!!!!
It depends on the amount of disk space you have, so you can lower it, I will write how.
You have to do this as root. Explanation is for RHEL and deratives. With Debian and deratives you might need to use the sudo command in front of the commands.

# Check disk space
df -h

# Check if there is already swap active
swapon --show

# Create 4 GB swap file
cd /
sudo dd if=/dev/zero of=/swapfile bs=1G count=4
if you have little disk space and only want a 2 gb swap space, change the count=4 to count=2

# Set the correct permission
chmod 600 /swapfile

# Setup and activate swapfile
mkswap /swapfile
swapon /swapfile

# Make changes permanent
echo /swapfile swap swap defaults 0 0 >> /etc/fstab
or edit the /etc/fstab file and add this line:
/swapfile swap swap defaults 0 0

# Doublecheck if it's working now
swapon --show
free

Reboot vps/server and check again with the free or swapon --show command.

Good luck. :)
Seems like it is working, now scanning forever not finished yet (but if it works I would kiss you ! (if your weren't a dude ) ) hehe
 
Last edited:
Now I got the results:

----------- SCAN SUMMARY -----------
Known viruses: 8707440
Engine version: 0.103.11
Scanned directories: 107606
Scanned files: 1499628
Infected files: 83
Total errors: 12627
Data scanned: 74676.35 MB
Data read: 108591.29 MB (ratio 0.69:1)
Time: 13305.863 sec (221 m 45 s)
Start Date: 2024:04:24 02:00:07
End Date: 2024:04:24 05:41:53

How do I get rid of the viruses ?
 
Read on how to run clamscan and remove infected files:

Code:
man clamscan

or


But depending on which files are infected, you might corrupt your site if you remove the files. So you will do it on your own risk. We don't guarantee anything, unless me or other guys here do the job by their hands.
 
Read on how to run clamscan and remove infected files:

Code:
man clamscan

or


But depending on which files are infected, you might corrupt your site if you remove the files. So you will do it on your own risk. We don't guarantee anything, unless me or other guys here do the job by their hands.
Can't see an option really of deleting or put to jail this files wih "man clamscan"

We don't guarantee anything, unless me or other guys here do the job by their hands.

Not asking for that, more like a public share of how people can learn to do it themselves as well.

(I need to learn ! haha)


*********

"I used this one at my own risk :

clamscan -r --remove /

But well I do know how to fix a broken WordPress website not such big of a deal. More finding impossible to find viruses on a VPS that is harder.
 
Last edited:
Can't see an option really of deleting or put to jail this files wih "man clamscan"

You are welcome, to use a web-version of the man pages by the link in the previous reply then. Sorry, not going to copy/paste the flags from the man-pages. We expect administrators and server owners to know at least basic things about running servers and searching information in Internet.

Thank you.
 
You are welcome, to use a web-version of the man pages by the link in the previous reply then. Sorry, not going to copy/paste the flags from the man-pages. We expect administrators and server owners to know at least basic things about running servers and searching information in Internet.

Thank you.
Doing my best thank you so much!
 
While clamscan is good enough, the next step would be to use clamdscan . The latest will run faster, but will require Clamd running as a daemon. ClamAV is known to be greedy for RAM, and if your server has only 5GB RAM, then I would not recommend running ClamAV as daemon on an ongoing basis.

But, ClamAV should run as daemon on an ongoing basis if you want to use maldet. The malware scanner maldet uses ClamAV as a scanner and offers more controls.

You might search the forums for more information about maldet. And read this guide:

 
While clamscan is good enough, the next step would be to use clamdscan . The latest will run faster, but will require Clamd running as a daemon. ClamAV is known to be greedy for RAM, and if your server has only 5GB RAM, then I would not recommend running ClamAV as daemon on an ongoing basis.

But, ClamAV should run as daemon on an ongoing basis if you want to use maldet. The malware scanner maldet uses ClamAV as a scanner and offers more controls.

You might search the forums for more information about maldet. And read this guide:


Ah I see now there is a letter difference. And yes I will go search on the forum for that and study about it. Thank you so much for your support and help.
 
not understanding this why ...
That is normal. If clamd@scan is running just ignore it. We get the same after a clamscan/clamav update. After the update, the timeout to check servers from DA is too short for clamav, causing this error.
If you look a few minutes later in the services status in DA you will see that it's running.
 
Back
Top