Setting the immutable flag on a file or folder will prevent any changes to it. For folders, this means that no files or folders may be added to or removed from the immutable folder. However, files and folders in the immutable folder can be modified.
Please note, making certain files immutable can affect the functionality of certain services, including cPanel. If you are performing this operation, please make sure you understand the potential consequences.
To make a file or a directory immutable, use the "chattr" command with the "+i" flag.
chattr +i /path/to/file
The following article explains how to remove the immutable flag.