Limit vsftp upload to a given set of file-names
- by Chen Levy
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?