使用clamav掃描危險文件
1.安裝epel
```
# RHEL/CentOS 6:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# RHEL/CentOS 7:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
```
2.安裝clamav
```
yum install -y clamav
```
3.配置Clamav
修改/etc/freshclam.conf 和 /etc/clamd.d/scan.conf ,將 文中“Example” 注釋掉,如“#Example”
4.升級病毒庫
```
freshclam
```
5.查殺病毒
```
clamscan --infected --recursive -- remove --exclude-dir="^/sys" /
```
--infected 打印感染的文件
--exclude-dir="^/sys" 不掃描 /sys目錄
--recursive 遍歷所有子目錄及文件
**-- remove需要慎用,可以在確認文件缺失被感染后手動刪除**
6.自動更新病毒庫
在計劃任務中添加,定時更新病毒庫命令
crontab內容如下:
```
* 1 * * * freshclam --quiet ##每天1點更新病毒庫
```
7. 自動查殺病毒
在計劃任務中添加,定時查殺病毒命令
crontab內容如下:
```
* 20 * * * clamscan -r / -l /var/log/clamscan.log --remove ##每天20點查殺病毒
```
- Linux
- 高級
- 殺毒
- 記一次中毒事件
- clamav查毒軟件
- 處理挖礦病毒
- 定時任務
- kill
- chattr文件保護
- 運行級別
- Linux啟動
- 文件加密
- ssh免密登錄
- .ssh
- 問題
- 腳本
- 阿里云域名解析
- yum源
- 時間同步
- keepalived實現高可用
- dos字符與unix字符
- 大文件上傳
- 基礎
- proc目錄
- 設置宋體
- 基礎命令_01
- 基礎命令_02
- SELinux
- 文件描述符
- 基礎命令_03
- awk
- 系統日志
- date命令
- bc命令
- lsof
- vim快捷鍵
- shell
- 循環控制
- expr
- 執行腳本的方式
- declare
- shell腳本
- 控制啟停腳本
- 數值計算
- centos
- 配置網絡
- 環境
- 灰度環境
- ansible
- 模塊
- 語法
- file模塊
- setup模塊
- ping模塊
- copy模塊
- command模塊
- shell模塊
- service模塊
- cron模塊
- yum模塊
- user 模塊
- group模塊
- 指定用戶
- playbook
- 實例
- ansible安裝
- Jenkins
- shell部署
- 導入已有項目的配置
- 執行shell
- tungsten數據同步
- 防火墻
- netfilter