Introduction
Please keep in mind that the management of filesystem attributes is a task that is best handled by a systems administrator with the skills, training, and experience required to do so for you. Although this task is not related to cPanel, we would like to offer the following guide as a courtesy.
You may use the following instructions to determine if a file is marked as immutable.
The description of the immutable attribute is best explained by the manual page for the chattr utility:
# man chattr | grep -A1 "'i' attribute"
A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process
possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
Procedure
- Login to the server via SSH or Terminal as the root user
- Run the following command and be sure to replace the path to the file with your own:
lsattr /path/to/file.txt
NOTE: If you need to see the attributes of a directory, you must run the command on the directory above the directory that you are interested in.
When reviewing the results, the immutable bit is represented by a lower case i symbol. This should not be confused with the upper case I symbol which represents an indexed directory instead.
Here is an example of an immutable directory:
[root@test testing]# lsattr /root/testing
----i--------e-- /root/testing/immutableDirectory
Notice that in order to view the attributes of the immutableDirectory, the /root/testing directory was used in the command.
Here is an example of an immutable file:
[root@test testing]# lsattr /root/testing/regularDirectory/
----i--------e-- /root/testing/regularDirectory/immutableFile.txt
If you have additional questions about how this works, please consult the manual pages on your server with the following commands:
man chattr
man lsattr
The process for removing the immutable attribute can be found in the manual pages above, or in the following guide: