Prevent Files And Folders From Accidental Deletion Or Modification In Linux

Prevent Files And Folders From Accidental Deletion Or Modification In Linux

7 Responses

  1. David Okwii says:

    Wow, I didn’t know about this feature. Only knew about setting file/directory permissions. Thanks for the tutorial.

  2. Bishwajit Samanta says:

    Wowwwwwww awesome feature

  3. wbgreene333 says:

    I’ve always thought this would be a great feature for distributions to implement on key system files as root kit malware defense.

    First add a separate password requirement for setting/resetting the immutable attribute and second add a separate logfile of attempts to change an immutable file. It would make system updating need some changes for the separate password in order to make changes to key files, but I think it’d be worth it.

    • SK says:

      > First add a separate password requirement for setting/resetting the
      immutable attribute and second add a separate logfile of attempts to
      change an immutable file.

      Good point! But I have no idea how to set separate a separate password.

      • wbgreene333 says:

        I’m afraid that adding a separate password to the attribute before allowing changes would be a job for kernel developers, and likely a difficult “sell”.

        As it stands now the immutable attribute is minimally useful since if the malware gets root, immutable is easily removed.

  4. Kirby says:

    I got an error:
    $ sudo chattr +i .p
    chattr: Operation not permitted while setting flags on .p

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.