• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Linux Permissions

mmaki

Member
What Linux permissions do I give a directory if I want the users, who are members of the group the directory is in, to be able to read and write but not delete (except for the owner/creator)? I understand this has to do with the SUID/SGID and Sticky Bit which I can't seem to get quite right.

For example I have a shared directory in a division under home that I want all users of the division (admin) to be able to read and write but not delete.

/home/admin/shared

All users in admin are members of the admin group and the "shared" directory is in the group admin. Home, admin, and shared are owned by root.

Thanks!


 
Give those users read only permission on the directory itself, not the individual files. Then set the stick bit on the directory chmod g+s <directory name..

If you do that any time a user wants to rename or delete a file they must either: A) own the file themselves; B) have write permission for the directory; C) or be root.
 
Your question on read/write but no delete will require the use of ACL's. Basic permissions on files and directories do not give you that wide of a setting. It gives you read, write and execute only, and write means write which always includes delete.
 
TonyRic &amp; Damaged thanks for the replies. I've done a little research since my posting and this is what I found. I don't think I need to deal with ACL's because of the sticky bit, but again I'm a newbie at this so I could very well be wrong. When I get back to the office next week I do some experimenting with this and see what I can come up with. Thanks again!
 
Back
Top