LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 03: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, 07:51 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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 07:53 PM.
 
Old 01-09-2006, 07: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 07:59 PM.
 
Old 01-10-2006, 05: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



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 01:53 AM
deleting all *.m3u files in a directory+subdir? minm Linux - Newbie 5 10-12-2004 03:31 PM
how do i prevent the directory/file links from showing in the absence of index.*? spyghost Linux - Networking 2 10-08-2004 10:52 AM
prevent files from getting copied even though they have read permission arnieboy Linux - Security 9 10-08-2003 03:12 PM
mount -- changing directory permission newbie_jubie Linux - Software 5 02-15-2002 01:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:56 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
Open Source Consulting | Domain Registration