LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-14-2011, 05:22 PM   #1
cbc
LQ Newbie
 
Registered: Jun 2011
Posts: 20

Rep: Reputation: Disabled
User permissions


Hi,

There are 3 users in my group. For only one user, I need to assign read and write but no delete permissions. The other 2 users should have all the permissions.

How can I do this ? Please help.

Thanks,

Ram
 
Old 07-14-2011, 05:49 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Is this (no delete) for the dir itself, or just the files inside it.
Note that Unix only has read/write/execute for files (x = search for a dir) and that deleting a file is a write to the dir file itself.
Unix does not have a 'delete' perm you can turn on or off.
https://secure.wikimedia.org/wikipedia/en/wiki/Inode
http://www.linfo.org/inode.html
 
Old 07-14-2011, 05:54 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you set the sticky bit on the directory, a non owner user will not be able to delete the file even if they have write access on the directory.
Look at using acls to give you finer control over permissions. You want to set the permissions for both the directory and the default permissions on the directory as well.
 
1 members found this post helpful.
Old 07-14-2011, 09:32 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
And you can always create a "priv" group (pick whatever name you want), make that group the file's group with "delete" permission, and put (yourself and) the two "deleters" in the new group.
 
Old 07-14-2011, 10:46 PM   #5
cbc
LQ Newbie
 
Registered: Jun 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thanks PTrenholme .. but the 3 users should be in the same group ..
 
Old 07-15-2011, 04:45 PM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Quote:
Originally Posted by cbc View Post
Thanks PTrenholme .. but the 3 users should be in the same group ..
Why?

They can, of course, be in the same group. Just set up the new group with the two "deleters" in it, and make that new group the flies' group. Give the "Others" read access, and you're "home free."

Note, as pointed out above, you might "fix" your problem by doing this trick on the directory, not the files inside the directory. That is, give everyone "x" on the directory, but only the owner and the group "w," and make that the new group.

Remember, there's no limit on the number of groups of which a user can be a member. So your two users can be members of the old group and the "new" group at the same time, and only "new" group members will be able to delete the files. (Or, if you "fix" the directory, make any changes in the directory.)
 
1 members found this post helpful.
  


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
[SOLVED] filesystem permissions question - making so user can't change permissions? c0pe Linux - Security 4 07-12-2010 09:06 AM
user permissions CosmicSea Linux - Newbie 2 01-23-2010 07:05 AM
how to automount usb drives with user owner and user r/w permissions mike11 Linux - Newbie 1 11-19-2009 02:59 PM
Giving user 'www-data' same permissions as normal user MikeOfAustin Linux - Software 5 06-08-2007 02:50 AM
user permissions djroketboy Linux - Networking 7 10-02-2003 02:40 PM


All times are GMT -5. The time now is 11:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration