- Install
# portmaster security/clamav
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Options for clamav 0.97 x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x [X] ARC Enable arch archives support x x
x x [X] ARJ Enable arj archives support x x
x x [X] LHA Enable lha archives support x x
x x [X] UNZOO Enable zoo archives support x x
x x [X] UNRAR Enable rar archives support x x
x x [ ] LLVM Enable JIT Bytecode compiler (bundled LLVM) x x
x x [X] LLVM_PORTS Enable JIT Bytecode compiler (from Ports) x x
x x [X] TESTS Run compile-time tests (req. python) x x
x x [ ] MILTER Compile the milter interface x x
x x [ ] LDAP libmilter was built with LDAP x x
x x [X] ICONV Enable ICONV support x x
x x [ ] STDERR Print logs to stderr instead of stdout x x
x x [ ] EXPERIMENTAL Build experimental code x x
x x x x
x x x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
- Configure
# vi /usr/local/etc/clamd.conf
LogTime yes
#User clamav
# vi /usr/local/etc/freshclam.conf
DatabaseOwner root
DatabaseMirror db.jp.clamav.net
# vi /etc/rc.conf
clamav_clamd_enable="YES"
clamav_freshclam_enable="YES"
- 起動
# /usr/local/etc/rc.d/clamav-clamd start
Starting clamav_clamd.
LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
# /usr/local/etc/rc.d/clamav-freshclam start
Starting clamav_freshclam.
- ウィルス定義更新
# freshclam
- ※今ここでエラー(;´Д`)
- スキャン
# clamscan --infected --remove --recursive
----------- SCAN SUMMARY -----------
Known viruses: 905136
Engine version: 0.97
Scanned directories: 6
Scanned files: 16
Infected files: 0
Data scanned: 0.18 MB
Data read: 0.09 MB (ratio 2.00:1)
Time: 3.131 sec (0 m 3 s)
- 定期スキャン
# vi /etc/periodic/daily/600.clamscan
#!/bin/sh
/usr/local/bin/clamscan -i -r --remove /home >> /var/log/clamav/clamscan.log 2>&1
- ログローテーション
# vi /usr/local/etc/logrotate.d/clamav
/var/log/clamav/clamscan.log{
monthly
rotate 4
missingok
}