偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

如何在PureFTPd中集成ClamAV

系統(tǒng) Linux
Pureftpd是一款在多種類(lèi)Unix上使用并符合GPL協(xié)議的原代碼開(kāi)放的軟件,顧名思義,它就是一款純粹的Ftp程序。那怎樣在PureFTPd中集成ClamAV呢,看下文。

Pureftpd是一款快速,高質(zhì)量,功能齊全的ftp服務(wù)器,最重要的是可以支持設(shè)置客戶端默認(rèn)編碼,今天我給大家詳細(xì)介紹下:在PureFTPd中集成ClamAV的方法

  PureFTPd是Linux下一款非常好用的的FTP服務(wù)器端軟件,但隨著Linux的普及,病毒也開(kāi)始瞄向Linux,以前我們?cè)贚inux下經(jīng)常裸奔,現(xiàn)在我們應(yīng)當(dāng)重視Linux服務(wù)器的安全,本文就簡(jiǎn)單介紹一下如何將Linux下大名鼎鼎的反病毒軟件ClamAV與PureFTPd結(jié)合,當(dāng)有人通過(guò)PureFTPd上傳文件時(shí),ClamAV就會(huì)自動(dòng)進(jìn)行掃描,如果發(fā)現(xiàn)上傳的文件包含病毒就自動(dòng)刪除。

  1、說(shuō)明

  首先我不能保證你按照我介紹的步驟操作,能讓ClamAV和PureFTPd聯(lián)合運(yùn)行,因?yàn)槟阄业沫h(huán)境可能不一樣,我是在OpenSUSE 11.2下做的實(shí)驗(yàn)。

  2、安裝ClamAV

  安裝ClamAV的命令如下,非常簡(jiǎn)單:

  yast2 -i clamav clamav-db

  接下來(lái)是為ClamAV創(chuàng)建系統(tǒng)啟動(dòng)項(xiàng):

  chkconfig --add clamd

  然后啟動(dòng)它:

  /etc/init.d/clamd start

  3、配置PureFTPd

  首先用文本編輯器打開(kāi)PureFTPd的配置文件/etc/pure-ftpd/pure-ftpd.conf:

  vi /etc/pure-ftpd/pure-ftpd.conf

  將Umask設(shè)置項(xiàng)的值設(shè)為133:022,這樣clamdscan才有權(quán)掃描上傳的文件,同時(shí)將CallUploadScript設(shè)為yes:

 

  1.   [...]# File creation mask. : .# 177:077 if you feel paranoid.Umask 133:022[...]# If your pure-ftpd has been compiled with pure-uploadscript support,# this will make pure-ftpd write info about new uploads to# /var/run/pure-ftpd.upload.pipe so pure-uploadscript can read it and# spawn a script to handle the upload.CallUploadScript yes[...]  
  2.  

 

 

 

  接下來(lái)創(chuàng)建一個(gè)/etc/pure-ftpd/clamav_check.sh文件,無(wú)論何時(shí)通過(guò)PureFTPd上傳文件時(shí),都會(huì)觸發(fā)它調(diào)用ClamAV主程序/usr/bin/clamdscan掃描上傳的文件:

  vi /etc/pure-ftpd/clamav_check.sh

  clamav_check.sh腳本的內(nèi)容如下:

 

  1.   #!/bin/sh/usr/bin/clamdscan --remove --quiet --no-summary "$1" 

 

  將這個(gè)腳本文件設(shè)為可執(zhí)行:

  chmod 755 /etc/pure-ftpd/clamav_check.sh

  現(xiàn)在我們將pure-uploadscript作為一個(gè)后臺(tái)程序啟動(dòng),當(dāng)有文件通過(guò)PureFTPd上傳時(shí),它就會(huì)調(diào)用我們編寫(xiě)的/etc/pure-ftpd/clamav_check.sh基本。

  pure-uploadscript -B -r /etc/pure-ftpd/clamav_check.sh

  如果你不想每次重啟系統(tǒng)后都要手工啟動(dòng)pure-uploadscript進(jìn)程,那打開(kāi)/etc/init.d/boot.local:

  vi /etc/init.d/boot.local

  向文件中添加一行/usr/sbin/pure-uploadscript -B -r /etc/pure-ftpd/clamav_check.sh,如:

 

  1.   #! /bin/sh## Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved.## Author: Werner Fink , 1996# Burchard Steinbild, 1996## /etc/init.d/boot.local## script with local commands to be executed from init on system startup## Here you should add things, that should happen directly after booting# before we're going to the first run level.#/usr/sbin/pure-uploadscript -B -r /etc/pure-ftpd/clamav_check.sh  
  2.  

 

 

  最后我們重啟PureFTPd:

  /etc/init.d/pure-ftpd restart

  OK!從現(xiàn)在開(kāi)始,如果有人上傳帶有惡意軟件的文件,ClamAV會(huì)為你自動(dòng)清理。

通過(guò)文章的介紹和描述,想必讀者們都知道了PureFTPd中集成ClamAV的過(guò)程。

【編輯推薦】

責(zé)任編輯:趙鵬 來(lái)源: 網(wǎng)絡(luò)轉(zhuǎn)載
相關(guān)推薦

2017-07-11 13:00:16

LinuxCentOS 7Samba4 AD

2021-11-01 14:52:38

ElasticSear索引SQL

2023-03-13 00:16:28

2011-08-24 10:32:03

LuaPlusC++Lua

2011-08-31 15:36:59

Lua解釋器

2025-01-26 00:00:40

Seata分布式事務(wù)

2011-08-24 09:49:38

VS2008Lua解釋器

2009-06-11 13:28:18

Glassfish集成

2015-08-14 10:18:56

2010-05-15 14:47:56

2011-03-02 13:16:33

Pureftpd

2009-06-23 09:33:20

FCKEditorJSFJSP

2011-02-25 16:22:34

2011-03-03 15:09:30

PureFTPdFAQ

2009-06-01 16:18:30

SpringJPA集成

2020-05-18 10:08:22

卓越集成中心ICoE

2011-07-20 17:10:05

iPhone iAd

2011-02-25 17:49:21

2011-03-03 16:17:14

PureFTPd

2011-03-03 14:42:12

PureFTPd
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)