How To Integrate ClamAV Into PureFTPd For Virus Scanning On Fedora 18
How To Integrate ClamAV Into PureFTPd For Virus Scanning On Fedora 18Version 1.0 This tutorial explains how you can integrate ClamAV into PureFTPd for virus scanning on a Fedora 18 system. In the end, whenever a file gets uploaded through PureFTPd, ClamAV will check the file and delete it if it is malware. I do not issue any guarantee that this will work for you!
1 Preliminary NoteYou should have a working PureFTPd setup on your Fedora 18 server, e.g. as shown in this tutorial: Virtual Hosting With PureFTPd And MySQL (Incl. Quota And Bandwidth Management) On Fedora 18.
2 Installing ClamAVClamAV can be installed as follows: yum install amavisd-new clamav clamav-data clamav-server clamav-update clamav-scanner Next we create the system startup links for clamd and start it: systemctl enable clamd.amavisd.service
3 Configuring PureFTPdFirst we open /etc/pure-ftpd/pure-ftpd.conf and set CallUploadScript to yes : vi /etc/pure-ftpd/pure-ftpd.conf
Next we create the file /etc/pure-ftpd/clamav_check.sh (which will call /usr/bin/clamdscan whenever a file is uploaded through PureFTPd)... vi /etc/pure-ftpd/clamav_check.sh
... and make it executable: chmod 755 /etc/pure-ftpd/clamav_check.sh Now we start the pure-uploadscript program as a daemon - it will call our /etc/pure-ftpd/clamav_check.sh script whenever a file is uploaded through PureFTPd: pure-uploadscript -B -r /etc/pure-ftpd/clamav_check.sh Of course, you don't want to start the daemon manually each time you boot the system - therefore we open /etc/rc.local... vi /etc/rc.local ... and add the line /usr/sbin/pure-uploadscript -B -r /etc/pure-ftpd/clamav_check.sh to it - e.g. as follows:
If /etc.rc.local does not exist, create it (with the #!/bin/sh line in the beginning) and then make it executable: chmod 755 /etc/rc.local Finally we restart PureFTPd: systemctl restart pure-ftpd.service That's it! Now whenever someone tries to upload malware to your server through PureFTPd, the "bad" file(s) will be silently deleted.
4 Links
|




Recent comments
19 hours 52 min ago
22 hours 48 min ago
1 day 2 min ago
1 day 1 hour ago
1 day 3 hours ago
1 day 4 hours ago
1 day 5 hours ago
1 day 21 hours ago
1 day 22 hours ago
2 days 2 hours ago