CentOSUbuntu

use chattr to lock file

1 min readNo comments yet

chattr

This command can be used to lock a file.

usage: chattr +i filename

The files locked by chattr cannot be modified or deleted, even with root permission.

For unlocking, use chattr -i filename.

Comments

Leave a comment

Comments are reviewed before they appear.