LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-09-2006, 04:42 AM   #1
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Rep: Reputation: 30
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
 
Old 01-09-2006, 08:51 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
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.

Last edited by bigrigdriver; 01-09-2006 at 08:53 PM.
 
Old 01-09-2006, 08:57 PM   #3
dimsh
Member
 
Registered: Aug 2005
Distribution: Debian, Ubuntu, Fedora
Posts: 74

Rep: Reputation: 15
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).

Last edited by dimsh; 01-09-2006 at 08:59 PM.
 
Old 01-10-2006, 06:41 AM   #4
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Original Poster
Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing file permissions within a directory for all files. cajunaggie Linux - Newbie 2 02-06-2005 02:53 AM
deleting all *.m3u files in a directory+subdir? minm Linux - Newbie 5 10-12-2004 04:31 PM
how do i prevent the directory/file links from showing in the absence of index.*? spyghost Linux - Networking 2 10-08-2004 11:52 AM
prevent files from getting copied even though they have read permission arnieboy Linux - Security 9 10-08-2003 04:12 PM
mount -- changing directory permission newbie_jubie Linux - Software 5 02-15-2002 02:06 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration