安装clamav杀毒软件,并在贵州节点上扫描查杀看是否存在病毒。
编译ClamAV时应包括zlib库,用于压缩和解压缩函数
软件:zlib-1.2.7.tar.gz clamav-0.97.6.tar.gz
软件下载地址:
http://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.7/zlib-1.2.7.tar.gz
http://nchc.dl.sourceforge.net/project/clamav/clamav/0.97.6/clamav-0.97.6.tar.gz
[root@ts181test]#wgethttp://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.7/zlib-1.2.7.tar.gz
[root@ts181test]#wget
http://nchc.dl.sourceforge.net/project/clamav/clamav/0.97.6/clamav-0.97.6.tar.gz
[root@ts181 test]# tar xfzlib-1.2.7.tar.gz
[root@ts181 test]# cd zlib-1.2.7
[root@ts181 zlib-1.2.7]# ./configure
[root@ts181 zlib-1.2.7]# make &&make install
[root@ts181 zlib-1.2.7]# cd ..
添加用户组clamav和组成员clamav(注:在安装clamav-0.97.6.tar.gz前必须先添加用户)
[root@ts181 test]# groupadd clamav
[root@ts181 test]# useradd -g clamav -s/bin/false -c "Clam AntiVirus" clamav
[root@ts181 test]# tar xfclamav-0.97.6.tar.gz
[root@ts181 test]# cd clamav-0.97.6
[root@ts181 clamav-0.97.6]# ./configure--prefix=/opt/clamav --disable-clamav
[root@ts181 clamav-0.97.6]# make&& make install
mkdir /opt/clamav/logs (日志存放目录)
mkdir /opt/clamav/updata (clanav 病毒库目录)
在/var/log目录下添加两个logs文件:clamd.log和freshclam.log,将所有者改为新加的clamav用户,并设置相应的文件读写权限
touch /opt/clamav/logs/freshclam.log
touch /opt/clamav/logs/clamd.log
[root@ts181 clamav-0.97.6]# cd/opt/clamav
[root@ts181 clamav]# vim etc/clam.conf
# Example 注释掉这一行. 第8 行
LogFile /opt/clamav/logs/clamd.log
PidFile /opt/clamav/updata/clamd.pid
DatabaseDirectory /opt/clamav/updata
[root@ts181 clamav]# vimetc/freshclam.conf
#Example 注释掉这一行
DatabaseDirectory /opt/clamav/updata
UpdateLogFile/opt/clamav/logs/freshclam.log
PidFile/opt/clamav/updata/freshclam.pid
[root@ts181 clamav]# chown clamav:clamav/opt/clamav -R
[root@ts181 clamav]#/opt/clamav/bin/freshclam
##升级病毒库
[root@ts181 clamav]#/opt/clamav/bin/clamscan --查杀当前目录下的文件
[root@ts181 clamav]#/opt/clamav/bin/clamscan -r --查杀当前目录的所有文件及目录
[root@ts181 clamav]#/opt/clamav/bin/clamscan /home/leng --查杀dir目录
[root@ts181 clamav]# /opt/clamav/bin/clamscan-r /home/leng --查杀目录dir下的所有文件及目录
[root@ts181 clamav]#/opt/clamav/bin/clamscan --help
后台运行/opt/clamav/bin/freshclam-d
计划任务:
[root@ts181 clamav]# crontab -e
1 3 * * * /usr/local/clamav/bin/freshclam--quiet
20 3 * * * /usr/local/clamav/bin/clamscan -r/home --remove -l /var/log/clamscan.log
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。