System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

File permission: prevent folder owner

SOLVED
Go to solution
Johnson Punniyalingam
Honored Contributor

File permission: prevent folder owner

Is there a way to set the file permission of the a file such that folder owner cannot modify or delete files which he has no such permissions?

Example:
group1: user1, user2
folder: /testfolder
ownership: user1:group1
permission: 750
file1 : /testfolder/file1
ownership: user2:group1
permission: 740

user1 should not be able to delete the file even if he owns the main folder where the file is located.

Appreciate help. Thanks.


Problems are common to all, but attitude makes the difference
4 REPLIES
Modris Bremze
Esteemed Contributor
Solution

Re: File permission: prevent folder owner

It might be doable with ACLs. Please see http://docs.hp.com/en/B2355-90950/ch08s04.html
Horia Chirculescu
Honored Contributor

Re: File permission: prevent folder owner

Hello,

How about

chmod g-w file1
chmod u+rw file1
chmod o-rw file1

user1 still have write access on file1?

Horia.
Best regards from Romania,
Horia.
Dennis Handly
Acclaimed Contributor

Re: File permission: prevent folder owner

>user1 should not be able to delete the file even if he owns the main folder where the file is located.

The user can be prevented from modifying the file but nothing can stop him from removing it.
I.e. the user can always change the permissions or ACL to allow write.

The sticky bit would maybe stop a naive user from removing files, for a few seconds.
Johnson Punniyalingam
Honored Contributor

Re: File permission: prevent folder owner

Thanks for all your support
Problems are common to all, but attitude makes the difference