杀毒软件Clam AntiVirus的配置

1.安装杀毒软件

[root@centos ~]# yum -y install clamav clamav-server-systemd clamav-update clamav-scanner-systemd

2.病毒库更新相关设置

[root@centos ~]# vi /etc/freshclam.conf #病毒库更新设定文件配置

# Send the RELOAD command to clamd.
# Default: no
#NotifyClamd /path/to/clamd.conf
NotifyClamd /etc/clamd.d/scan.conf

[root@centos ~]# freshclam
ClamAV update process started at Sun Oct 16 18:05:20 2022
daily database available for download (remote version: 26691)
Time:   12.7s, ETA:    0.0s [========================>]   57.27MiB/57.27MiB
Testing database: '/var/lib/clamav/tmp.102a221a66/clamav-f8b1095191d9f71d405e52c6f21f9ed8.tmp-daily.cvd' ...
Database test passed.
daily.cvd updated (version: 26691, sigs: 2008286, f-level: 90, builder: raynman)
main database available for download (remote version: 62)
Time:   18.0s, ETA:    0.0s [========================>]  162.58MiB/162.58MiB
Testing database: '/var/lib/clamav/tmp.102a221a66/clamav-06d6d353828da8db4c3564942a324093.tmp-main.cvd' ...
Database test passed.
main.cvd updated (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
bytecode database available for download (remote version: 333)
Time:    0.4s, ETA:    0.0s [========================>]  286.79KiB/286.79KiB
Testing database: '/var/lib/clamav/tmp.102a221a66/clamav-8dd5bc22ac7a908cd6ae2d52d2f529db.tmp-bytecode.cvd' ...
Database test passed.
bytecode.cvd updated (version: 333, sigs: 92, f-level: 63, builder: awillia2)
ERROR: NotifyClamd: No communication socket specified in /etc/clamd.d/scan.conf
ERROR: Can't send to clamd: Socket operation on non-socket

3.Clam AntiVirus的配置

[root@centos ~]# vi /etc/clamd.d/scan.conf

# Run as another user (clamd must be started by root for this option to work)
# Default: don't drop privileges
#User clamscan #注释掉这一行

# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
LocalSocket /run/clamd.scan/clamd.sock #把这一行前面的#号去掉

4.启动Clam AntiVirus,并设置自动启动,设置病毒库更新自动启动。

[root@centos ~]# systemctl start clamd@scan
Job for [email protected] failed because a timeout was exceeded. See "systemctl status [email protected]" and "journalctl -xe" for details.

[root@centos ~]# vi /lib/systemd/system/[email protected]
[Service]
Type = forking
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf
# Reload the database
ExecReload=/bin/kill -USR2 $MAINPID
Restart = on-failure
TimeoutStartSec=600

[root@centos ~]# systemctl daemon-reload

[root@centos ~]# systemctl start clamd@scan

[root@centos ~]# systemctl enable clamd@scan

[root@centos ~]# systemctl start clamav-freshclam

[root@centos ~]# systemctl enable clamav-freshclam

你可能感兴趣的:(Linux,linux,运维,服务器)