Deny removal of files

19/08/2011 - 19:41 von P. Rego | Report spam
Hi
I have a shared folder which I'd like to deny the removal for anyone other than root and the owner. I tried to use

chmod 744 filename.sh
but did not work. So, when other user (than the owner) tries to delete it, the following message appears (and so on the file is deleted if yes option is provided):

rm filename.sh
filename.sh: override protection 744 (yes/no)?

So, how could I do it?
 

Lesen sie die antworten

#1 Hauke Laging
19/08/2011 - 20:27 | Warnen spam
P. Rego wrote on Freitag, 19. August 2011 19:41:

Hi
I have a shared folder which I'd like to deny the removal for anyone other
than root and the owner. I tried to use

chmod 744 filename.sh
but did not work. So, when other user (than the owner) tries to delete it,
the following message appears (and so on the file is deleted if yes option
is provided):

rm filename.sh
filename.sh: override protection 744 (yes/no)?

So, how could I do it?



Why do you write in English to a German newsgroup?

You need the sticky bit for the directory:

chmod o+t /parent/directory

On ext[234] you can block deletion rights for anyone (including root who is
the only one who can set and erase that flag) by the immutable bit. See
lsattr/chattr if this is interesting for your task.


Hauke
http://www.hauke-laging.de/ideen/
D44C 6A5B 71B0 427C CED3 025C BD7D 6D27 ECCB 5814

Ähnliche fragen