LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Changing File Permission in a FTP directory to prevent deleting of files (http://www.linuxquestions.org/questions/linux-software-2/changing-file-permission-in-a-ftp-directory-to-prevent-deleting-of-files-401118/)

shawnbishop 01-09-2006 03:42 AM

Changing File Permission in a FTP directory to prevent deleting of files
 
Good Day

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)

Kind Regards

Shawn Bishop

bigrigdriver 01-09-2006 07:51 PM

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.

dimsh 01-09-2006 07:57 PM

You can find your answer in this page:
http://vsftpd.beasts.org/vsftpd_conf.html

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).

shawnbishop 01-10-2006 05:41 AM

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.

Thanks Again


All times are GMT -5. The time now is 11:11 AM.