chattr to secure files
Security is very important, If you want to set secure your files & don’t want to modify that file by anyone ? then use chattr
Step1. To set chattr
[[email protected] local]# ls -ld adminbirds.php -rw-r--r-- 1 root root 0 Jun 10 11:43 adminbirds.php [[email protected] local]#
Here I have a file adminbirds.php with 644 permission
chattr +i adminbirds.php
Now the file is immutable
To see the immutable file
[[email protected] local]# lsattr adminbirds.php ----i--------e-- adminbirds.php [[email protected] local]#
How to remove immutable permission on the file
To remove immutable permission
[[email protected] local]# chattr -i adminbirds.php [[email protected] local]#
Now see
[[email protected] local]# lsattr adminbirds.php -------------e-- adminbirds.php [[email protected] local]#
There is no permission called “i”
That’s all … 🙂