Deny file/directory deletion and directory creation in vsftpd
Some times there is situation when we need users to be able to upload files to ftp server but not allowed to delete files/directories and create directory.
vsftpd have cmds_allowed directive that can be used for this purpose. In this directive, specifies a comma-delimited list of FTP commands allowed by the server. All other commands not specified are rejected.
Here are the FTP commands that can be used for this directive.
#cmds_allowed=ABOR,ACCT,ALLO,APPE,CDUP,CWD,DELE,EPRT,EPSV,FEAT, HELP,LIST,MDTM,MODE,NLST,NOOP,OPTS,PASS,PASV,PORT,PWD,QUIT,REIN, REST,RETR,RMD,RNFR,RNTO,SITE,SIZE,SMNT,STAT,STOR,STOU,STRU,SYST, TYPE,USER,XCUP,XCWD,XPWD,XRMD,MKD,MKDIR,XMKD
For example, to deny user from deleting file/direcotries and create directory, remove this commands from the list: DELE,RMD,XRMD,MKD,MKDIR,XMKD