Make files undeletable with chattr

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Make files undeletable with chattr

#1 Post by Lobster »

Here is a cool tip on how you can make files on your system immutable. By immutable, I mean even root can't delete the files if he choose to. Linux ships with a tool called chattr which can be used for the purpose. 'chattr' is similar to the 'attrib' DOS equivalent tool but much more powerful and flexible.
To make your file (test_file) immutable

# chattr +i test_file

Full info
http://tinyurl.com/9mkzk
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

Thanks.

#2 Post by brad_chuck »

Cool.. This could be usefull some day.

chattr +i brad's_10_page_paper.txt

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#3 Post by Pizzasgood »

Lobster-proof system:
chattr +i -R /*
(assuming it has the -R recursive option)

Just kidding. I haven't heard of you crashing and burning in months. You must have learned to waddle over ice like a true penguin-puppy-lobster hybrid :wink:
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

Post Reply