miércoles, 14 de diciembre de 2011

A New Trick: Immutable Files!

Today, I learned from Joany, a fellow Mepis user at the Mepis Community Forums, this nice trick to make files immutable. She says:

"Occasionally, changes to a configuration file that are done manually won't "stick" because a process resets those changes back to default values. Changing file permissions to "read only" does not work when root owns the file and the process making the change."

If you make the file immutable, then nothing or no one will change it, not even root.

So, how does it work? You just have to enter as root this command:

chattr +i filename


If you need to alter the file in the future, the code below will return your file to its normal properties:

chattr -i filename

Hehe! I'm eager to try this trick with the next immutable malware file that gets into my USB pendrive! Thank you, Joany!

3 comentarios:

  1. Heh.. sounds fun. This sounds good for backup text files you don't want to alter by mistake later.

    ResponderEliminar
  2. @ Fenrir,

    That's a good idea! Be warned, however, that if you copy those files into different locations, the copies do not keep the immutability of the original files. On a different note, if you want to maximize fun, you could try it with a friend who uses Linux but doesn't know the trick and and awkward file! :P

    ResponderEliminar
  3. Very interesting trick. I hope I can get to try it soon!

    ResponderEliminar