标签:软件 日志 杀毒 download 更新 ping ln -s 根据 files
https://www.cnblogs.com/bingo1024/p/9018212.html
正文
1
|
yum install clamav clamav-server clamav-data clamav-update clamav-filesystem clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd pcre* gcc zlib zlib-devel libssl-devel libssl openssl |
这种方法安装后,病毒库默认地址是/var/lib/clamav。
(自测使用)centos6 启动
[root@yao ~]# service clamd status
clamd (pid 15154) 正在运行...
[root@yao ~]# service clamd stop
Stopping Clam AntiVirus Daemon: [确定]
[root@yao ~]# service clamd start
Starting Clam AntiVirus Daemon: LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
[确定]
更新病毒库:
[root@yao ~]# /usr/bin/freshclam
#官网地址: http://www.clamav.net/downloads #Linux中下载地址: wget http://www.clamav.net/downloads/production/clamav-0.100.0.tar.gz
#参考文档:
https://github.com/vrtadmin/clamav-faq/raw/master/manual/clamdoc.pdf
#clamav用户和用户组
groupadd clamav && useradd -g clamav clamav && id clamav
#日志存放目录
mkdir -p /usr/local/clamav/logs
touch /usr/local/clamav/logs/clamd.log
touch /usr/local/clamav/logs/freshclam.log
chown clamav.clamav /usr/local/clamav/logs/clamd.log
chown clamav.clamav /usr/local/clamav/logs/freshclam.log
#病毒存放目录
mkdir -p /usr/local/clamav/updata
chown -R root.clamav /usr/local/clamav/
chown -R clamav.clamav /usr/local/clamav/updata/
tar xf clamav-0.100.0.tar.gz
yum install gcc openssl openssl-devel -y
cd clamav-0.100.0/
./configure --prefix=/usr/local/clamav --with-pcre
make && make install
echo $?
cd /usr/local/clamav/etc cp clamd.conf.sample clamd.conf cp freshclam.conf.sample freshclam.conf vim clamd.conf #Example 注释掉这一行. 添加下面三行: LogFile /usr/local/clamav/logs/clamd.log PidFile /usr/local/clamav/updata/clamd.pid DatabaseDirectory /usr/local/clamav/updata
vim freshclam.conf #Example 注释掉这一行. 添加下面三行 DatabaseDirectory /usr/local/clamav/updata UpdateLogFile /usr/local/clamav/logs/freshclam.log PidFile /usr/local/clamav/updata/freshclam.pid
chown -R clamav.clamav /usr/local/clamav/
systemctl start clamav-freshclam.service
systemctl enable clamav-freshclam.service
systemctl status clamav-freshclam.service
#先停止freshclam
systemctl stop clamav-freshclam.service
#再更新
/usr/local/clamav/bin/freshclam (根据网络质量确定更新时长)
或者
cd /usr/local/clamav/share/clamav wget http://database.clamav.net/main.cvd wget http://database.clamav.net/daily.cvd wget http://database.clamav.net/bytecode.cvd
#更新完成启动
systemctl start clamav-freshclam.service
systemctl status clamav-freshclam.service
#创建软链接
ln -s /usr/local/clamav/bin/clamscan /usr/local/sbin/clamscan
说明:如果在手动更新病毒库的时候遇到错误,此时就要删除掉旧的镜像地址文件#rm -f /var/lib/clamav/mirrors.dat,再手动更新一次病毒库。
clamdscan:
clamdscan /usr
clamscan:
扫描参数:
#扫描所有文件并且显示有问题的文件的扫描结果 clamscan -r --bell -i / #只显示找到的病毒信息 clamscan --no-summary -ri /tmp #扫描home clamscan --infected --remove --recursive /home
#让服务器每天晚上定时更新和杀毒,保存杀毒日志,crontab文件如下: 1 3 * * * /usr/local/clamav/bin/freshclam --quiet 20 3 * * * /usr/local/clamav/bin/clamscan -r /home --remove -l /var/log/clamscan.log
标签:软件 日志 杀毒 download 更新 ping ln -s 根据 files
原文地址:https://www.cnblogs.com/yaok430/p/9234837.html