Limit vsftp upload to a given set of file-names
        Posted  
        
            by Chen Levy
        on Server Fault
        
        See other posts from Server Fault
        
            or by Chen Levy
        
        
        
        Published on 2010-03-16T10:22:11Z
        Indexed on 
            2010/03/16
            10:26 UTC
        
        
        Read the original article
        Hit count: 628
        
I need to configure an anonymous ftp with upload. Given this requirement I try to lock this server down to the bear minimum.
One of the restrictions I wish to impose is to enable the upload of only a given set of file-names.
I tried to disallow write permission to the upload folder, and put in it some empty files with write permission:
/var/ftp/         [root.root] [drwxr-xr-x]
|-- upload/       [root.root] [drwxr-xr-x]
|   |-- upfile1   [ftp.ftp]   [--w-------]
|   `-- upfile2   [ftp.ftp]   [--w-------]
`-- download/     [root.root] [drwxr-xr-x]
    `-- ...
But this approach didn't work because when I tried to upload upfile1, it tried to delete and create a new file in its' place, and there is no permissions for that.
Is there a way to make this work, or perhaps use a different approach like abusing the deny_file option?
© Server Fault or respective owner