rockylinux 9安裝防軟體clamAV

即時掃瞄;自動更新病毒碼

1.安裝 epel-release

sudo dnf install epel-release yum-utils -y

2.安裝clamAV

sudo dnf install clamav clamd clamav-update -y

確認版本

clamd --version

3.設定SELinux for ClamAV

sudo setsebool -P antivirus_can_scan_system 1

4.移除scan設定檔,把Exmaple等字詞移除(直接檔成預設)

sudo sed -i -e "s/^Example/#Example/" /etc/clamd.d/scan.conf

5.設定scan.conf

sudo nano /etc/clamd.d/scan.conf

找到下面這段,把#拿掉

#LocalSocket /var/run/clamd.scan/clamd.sock

6.設定更新病毒碼設定檔 (移除Example字樣)

sudo sed -i -e "s/^Example/#Example/" /etc/freshclam.conf

7.更新病毒碼

sudo freshclam

8.設成自動更新病毒碼

sudo systemctl enable clamav-freshclam
sudo systemctl start clamav-freshclam
sudo systemctl status clamav-freshclam

9.設定即時掃描

sudo systemctl start clamd@scan
sudo systemctl enable clamd@scan
sudo systemctl status clamd@scan
## on-access scanning
sudo systemctl start clamonacc
sudo systemctl enable clamonacc

其它

掃檔案

sudo clamscan filename

掃目錄

sudo clamscan -r directoryname

發表迴響