LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-09-2008, 12:17 AM   #1
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Rep: Reputation: 30
Help on Linux File Permissions


Hi

I want my users to have Read/Write/Execute Permission on a folder but there should not be able to delete any file from the folder which is created by them or any other user on the Domain. So this rules out sticky bit any other method to accomplish this?

I know about File acl's on Linux but I don't how to remove the "delete" permission from the folder for all the users except admins. Any1 would to shed some light on this please?
 
Old 03-09-2008, 07:15 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Being able to delete items inside a directory means having write rights on the inode of the directory.
 
Old 03-09-2008, 02:29 PM   #3
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
so if write permission is removed then delete permission is also removed right? So I cannot this thing done?
 
Old 03-09-2008, 02:53 PM   #4
Deleriux
Member
 
Registered: Nov 2003
Posts: 89

Rep: Reputation: 17
You can set the folder temporary (chmod 1777) and this will let users create files inside of the directory and only delete files they own instead of all the files in the directory.
 
Old 03-09-2008, 02:58 PM   #5
Deleriux
Member
 
Registered: Nov 2003
Posts: 89

Rep: Reputation: 17
This is exactly what you need, never thought it worked on folders .

Code:
chattr +a directory/

Keep permissions as they are already (dont do the temp thing I suggested above).

This sets the directory to "append only" which means files can be written to it but not removed.

Note that when using this attribute a file can only be appended and not modified so might not offer exactly what you want.
 
Old 03-09-2008, 05:11 PM   #6
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
Thats a good one but doesn't exactly work for me because people do modify the files a lot. The basic operations that happens on the shared data are Read/Write/Modify/Execute. It is just that we don't want the users to delete whatever content they are adding to the shared area.
 
Old 03-11-2008, 08:04 AM   #7
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 kool_kid View Post
so if write permission is removed then delete permission is also removed right? So I cannot this thing done?
Looks like the right conclusion to me.


Quote:
Originally Posted by kool_kid View Post
doesn't exactly work for me because people do modify the files a lot. The basic operations that happens on the shared data are Read/Write/Modify/Execute.
Read, write, exec OK, but AFAIK there's no "modify" syscall. Allowing write rights and doing '$>/some/file' clear a files content, which you don't want. So as I see it "modification" in your case is a definition based on your definition of the integrity of file contents, so filesystem access rights or extended attributes aren't going to work for you.


Quote:
Originally Posted by kool_kid View Post
It is just that we don't want the users to delete whatever content they are adding to the shared area.
Maybe you could look into like versioning through the filesystem (ext3cow or some overlay fs) or using an application (rsync, database, Wiki) instead? If that ain't working for you maybe you should explain in detail the reasons why it's critical people must not delete (partial) content.
 
  


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
Linux file permissions problems sean04 Linux - Newbie 3 11-27-2007 11:59 PM
Linux file permissions cleopard Linux - General 4 05-03-2006 08:25 AM
Linux file permissions soccertux Linux - General 3 03-18-2005 01:51 PM
Linux File Permissions - Need some help. richcom23 Linux - Networking 6 02-24-2004 01:51 PM
Linux file permissions jamrock Linux - Networking 3 05-19-2003 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:27 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