LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-13-2008, 04:56 PM   #1
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Rep: Reputation: 30
Permisions--- No Delete?


Is there a sneaky way to allow writes but not allow deletes to a given folders contents?
Trying to allow people to write to a samaba share but prevent them from deleting theres or others files.

Is thre a way to do a chown -R 555 on files but not directories?

Then I could have a mask of say 777 and run the above in a cron every hour to make the files read only but still allow people to create new files within the directories?

Last edited by jedimastermopar; 03-13-2008 at 05:03 PM.
 
Old 03-13-2008, 05:10 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by jedimastermopar View Post
Is there a sneaky way to allow writes but not allow deletes to a given folders contents?
Trying to allow people to write to a samaba share but prevent them from deleting theres or others files.

Is thre a way to do a chown -R 700 on files but not directories?

Then I could have a mask of 777 and run the above in a cron every hour to make the files read only but still allow people to create new files within the directories?
If you allow people to write to a file then they can destroy the file by writing garbage to the file. They don't have to be able to delete a file in order to destroy it. So allowing people to write to a file but not delete the file does not protect the file.

As to preventing people destroying other people's files the way to do that is to have the ownership and permissions for new files set up so that people cannot write to or delete files created by other users.

I suppose that you could make a user's existing files read only every few minutes with cron. However in any situation that I can imagine a good backup and recovery system is more useful than disallowing users from revising or deleting their own data.

---------------------
Steve Stites

Last edited by jailbait; 03-13-2008 at 05:22 PM.
 
Old 03-13-2008, 05:12 PM   #3
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
I don't want them to be able to write to them or delete either, I want them to be read only, but allow also allow them to write new files to the folders, and create new folders.
 
Old 03-13-2008, 05:16 PM   #4
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
One thing that I thought would work was to set the two variables likes this.

force create mode = 055
force directory mode - 6777


but when I create new files via a samba user in the share the files are all 777 and not 555 as I would have thought?

Also the reason we don't want to allow editing and deleting on this share is that we need to keep track of all file edits done, the idea is that people will version the files as they edit them.

Last edited by jedimastermopar; 03-13-2008 at 05:18 PM.
 
Old 03-13-2008, 05:27 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by jedimastermopar View Post
the idea is that people will version the files as they edit them.
People will be lazy, forget, make mistakes or willingly fsck up. if you require versioning why not use versioning?
 
Old 03-13-2008, 05:28 PM   #6
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
How do you enforce versioning on a directory?
 
Old 03-13-2008, 05:42 PM   #7
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
ok well i figured out how to get what I wanted but I think I woudl still rather be able to cron a chmod 444 to not include the directories. This would allow people to be able to delete things they put in by mistake for a certain ammoutn of time. Like run the cron nightly, to make the files read only.

I changed the
force create mod
to
create mask



Any ideas on how to change the permisions on files recorsivly while leaving the directories permisions in tact?
 
Old 03-15-2008, 06:25 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by jedimastermopar View Post
How do you enforce versioning on a directory?
AFAIK you don't. You can use an application that front-ends versioning as in SVN or CVS or a filesystem that allows versioning or snapshotting like CopyFS (uses FUSE) or ext3cow (usable but missing fsck). BTW, maybe also look into inotify tools like inotifywait since you could do stuff like trigger a copy on change.
 
  


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
Disable Delete permisions Dankles Linux - Security 2 05-05-2006 12:34 PM
howto chowto change file permisions in multiplhange file permisions in multiple dirs? pingvina Linux - Software 3 01-13-2006 03:10 PM
permisions charnel Linux - General 3 07-10-2005 02:53 PM
looking up file permisions starwind Linux - Newbie 1 10-15-2003 07:33 PM
Permisions ToeShot Linux - General 2 11-30-2001 12:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:32 PM.

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