Wednesday, July 9, 2008

immutable files

immutable files

immutable attribute. if this is set,even root cannot delete the file until the attribute is unset.

use lsattr command to see whether immutable flag is set for a file or a directory

to make a file immutable use chattr command with -i flag


ex:- touch keep.me
chattr +i keep.me
lsattr keep.me

rm -f keep.me

cannot remove keep.me operation not permitted

chattr -i keep.me
rm -f keep.me


changing immutable flag requires root authority.making files immutable is often done as part of a security / intrusion detection effort. see man capabilities for more information

No comments:

Post a Comment