IT lexicon › Security › chflags

chflags

Security På svenska → Updated: 2026-11-09

The BSD command and system call that sets file flags — most notably the one that makes a file immutable even to root.

File flags arrived with 4.4BSD and sit alongside the usual permissions. uchg makes a file immutable and can be set by its owner; schg is the system-level version, and sappnd allows only appends — handy for logs an intruder would love to tidy up. nodump tells dump to skip the file.

The point only becomes clear alongside securelevel: once the kernel runs at level 1 or higher, system flags cannot be cleared, not even by root, until the machine is rebooted into single-user mode. It's a blunt but honest defence. Linux's equivalent is chattr +i, and macOS inherited chflags through Darwin — where it's mostly used to hide ~/Library.

← Back to the lexicon