Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Note that these type of blocking scripts generally do not examine the files themselves; they only look at the extension. Thus, they can be circumvented by renaming the source file. –  Bacon Bits Jul 4 '11 at 5:10

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.