4

I use pure-ftp for ftp server. I want an for pure-ftp to deny the upload of certain file types, for example .exe, .bat, .cs, etc.

Many thanks.

Castaglia
  • 3,477
  • 3
  • 24
  • 46

1 Answers1

5

Pure-ftpd does not natively support blocking specific file types. However, you can accomplish this by running a script after the upload to delete the undesired file types.

You would use the pure-uploadscript program to accomplish this.

An example can be found here: http://www.webhostingtalk.com/showpost.php?p=6277573&postcount=4

(You will probably want to modify the banner to display what file types are not allowed.)

There is an inherent limitation this - a user could upload a file with an accepted extension and then rename it. You will probably want to scan the files (e.g. with clam-av) after they have been uploaded. You may also run a cron periodically to delete files with certain file extensions (e.g. uploaded by PHP, etc). I do believe that pure-ftpd has some options (-G -K) that disable deletion and/or renaming.

cyberx86
  • 21,105