Docs / Security / Understanding Linux File Immutable Attribute

Understanding Linux File Immutable Attribute

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 221 views · 1 min read

The immutable attribute prevents a file from being modified, deleted, or renamed — even by root.

Set Immutable

chattr +i /etc/resolv.conf

Remove Immutable

chattr -i /etc/resolv.conf

Check Attributes

lsattr /etc/resolv.conf

Use Cases

  • Protect DNS config from being overwritten
  • Prevent critical config files from accidental modification
  • Security hardening — make it harder for attackers to modify key files

Was this article helpful?