ClamAV is an mở cửa source antivirus tool. Bạn đang xem: How to install clamav on centos 7
This article will show you how to install and configure ClamAV on CentOS 7 & CentOS 8. I have also added some tips for Ubuntu.
Advertisement


6. Configure periodic scan using clamdscan (Optional)
You can follow this step if you wish khổng lồ configure tự động hóa scan of any directory as by default you will have lớn initiate manual scan.
Xem thêm: Tải Knights Of Valour Classic Arcade Game Cho Máy Tính Pc Windows Phiên Bản Mới Nhất
We will create a new systemd service unit file :
# mèo /etc/systemd/system/clamdscan-home.service
To perform a periodic scan we also need a mapping timer unit file. Here I have added time value of 18:40 to start the scan:
# cat /etc/systemd/system/clamdscan-home.timer
Next enable & start the timer
# systemctl enable clamdscan-home.timer --nowCreated symlink /etc/systemd/system/timers.target.wants/clamdscan-home.timer → /etc/systemd/system/clamdscan-home.timer.We don"t need lớn start the service unit tệp tin as it will be controlled by the timer file
Now we monitor the journalctl logs at 18:40 PM
Sep 05 18:40:05 server.example.com systemd<1>: Started ClamAV virus scan.Sep 05 18:40:17 server.example.com clamdscan<10901>: /home: OKSep 05 18:40:17 server.example.com clamdscan<10901>: ----------- SCAN SUMMARY -----------Sep 05 18:40:17 server.example.com clamdscan<10901>: Infected files: 0Sep 05 18:40:17 server.example.com clamdscan<10901>: Time: 11.725 sec (0 m 11 s)
7. Perform manual scan with clamscan
For a test scan of the current folder, we run the following command:
# clamscan --infected --remove --recursive ./----------- SCAN SUMMARY -----------Known viruses: 6702413Engine version: 0.100.2Scanned directories: 7Scanned files: 9Infected files: 0Data scanned: 0.01 MBData read: 0.00 MB (ratio 2.00:1)Time: 25.439 sec (0 m 25 s)
Here,
infected: prints only infected filesremove: removes infected filesrecursive: all the sub-directories in the provided directory will also be scannedConclusion
In this tutorial we learned about ClamAV scanner & it"s configuration in Linux. With different version of clamav the stepsof configuration seems to lớn be changing. As I am more comfortable with systemd, I have used the same to lớn demonstrate all the steps in this tutorial but you are free to write custom scripts with crond to perform auto scan and tự động update of the freshclam database.
Lastly I hope the steps from the article khổng lồ configure ClamAV on Ubuntu, CentOS 7 & CentOS 8 Linux was helpful. So, let me know your suggestions and feedback using the comment section.
References
I have used below external references for this tutorial guideman page for systemd timer