yum install clamav clamav-server clamav-lib clamav-data clamav-update
# /usr/bin/freshclam ERROR: Please edit the example config file /etc/freshclam.conf. ERROR: Can't parse the config file /etc/clamd.conf
# cp /usr/share/doc/clamav-server-0.85.1/clamd.conf /etc/clamd.conf
# Comment or remove the line below. # Example
# /usr/bin/freshclam
## It is ok to execute it as root; freshclam drops privileges and becomes ## user 'clamav' as soon as possible ## Note: replace 'MIN' and 'HOUR' with random values 0 3 * * * root /usr/bin/freshclam --quiet && { test -x /usr/sbin/clamav-notify-servers && exec /usr/sbin/clamav-notify-servers || :; }
#!/bin/bash # chkconfig: 345 80 20 # description: Clamd daemon . /etc/init.d/functions prog="/usr/sbin/clamd" prog_base="$(basename ${prog})" prog_config_file="/etc/clamd.conf" RETVAL=0 case "$1" in start) action $"Starting ${prog_base}:" ${prog} -c ${prog_config_file} RETVAL=$? echo ;; stop) echo $"Shutting down ${prog_base}" killproc ${prog_base} RETVAL=$? echo ;; status) status $"${prog_base}" RETVAL=$? ;; restart) $0 stop $0 start RETVAL=$? ;; reload) pid=`pidofproc ${prog_base}` kill -USR2 ${pid} RETVAL=$? ;; *) echo "Usage: $0 {start|stop|status|restart|reload}" exit 1 esac exit $RETVAL
# /etc/init.d/clamd start Starting clamd: ERROR: Can't get information about user <USER>. [失敗]
LogFile /var/log/clamd.log # ログファイルの出力先を指定します LocalSocket /var/run/clamd/clamd.sock # ソケットのファイルを指定します PidFile /var/run/clamd/clamd.pid # 起動プロセスidを保存するファイルを指定します #User <USER> # コメントにします
# mkdir /var/run/clamd/
# /etc/init.d/clamd start Starting clamd: [ OK ]
# /sbin/chkconfig --add clamd # /sbin/chkconfig --list clamd clamd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
# cd /tmp # wget http://www.eicar.org/download/eicar.com # ls eicar.com
# clamscan --infected --remove --recursive /tmp /tmp/eicar.com: Eicar-Test-Signature FOUND /tmp/eicar.com: Removed ----------- SCAN SUMMARY ----------- Known viruses: 36080 Engine version: 0.85.1 Scanned directories: 7 Scanned files: 14 Infected files: 1 ←みつかった! Data scanned: 51.53 MB Time: 57.997 sec (0 m 57 s)
# ls eicar.com ls: eicar.com: そのようなファイルやディレクトリはありません