Changing File Permission in a FTP directory to prevent deleting of files
I am running vsftp on a Fedora Core4 box as my FTP Server. I have diabled anon logins,so all users use a username and password to login.
What I want to do is once somebody has uploaded a file to the FTP server into a directory I want to be able to change the file permissions on that file to read only. Therefore even if you own the file you can delete it.
I want to do this as people are "losing" their files and accidently deleting them.
Does anybody have a script that can do it,or what i can set in the vsftpd.conf file to prevent deleting of files (I have read the man page on vsftp.conf)
You could try this:
Users have write permission to put files into the directory.
Then run a cron job to run at intervals to chmod -w all files currently in each directory.
You can find your answer in this page:
look for the value "file_open_mode" to set the umask for the uploded files to the desired value to prevent the write permission.
the default value is 0666, in your case it may be 0440. (do not forget the leading 0).
Sorry I made a mistake
"cant to be able to change the file permissions on that file to read only. Therefore even if you own the file you can delete it."
I meant to say,even if they own the file,and they uploaded it,once it is uploaded they CANNOT delete the file.So a user will upload a drawing to the Server,after that if they make a change to the drawing they have to upload another file,they cant overwrite or delete the file on the server.
|All times are GMT -5. The time now is 02:59 PM.|