隐藏权限
1. chattr (change attributes)
如果需要加某个隐藏属性 chattr + 参数, 如果想移除 chattr - 参数
参数:
a 只能附加内容,无法对原有内容覆盖、删除。 A file with the 'a' attribute set can only be open in append mode for writing.
i 不能修改文件,并且不能创建链接、删、重命名。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.
2. lsattr (list attributes)
[root@localhost tmp]# touch 1.txt
[root@localhost tmp]# ll
total 0
-rw-r--r--. 1 root root 0 Feb 16 18:48 1.txt
[root@localhost tmp]# chattr +i 1.txt
[root@localhost tmp]# ll
total 0
-rw-r--r--. 1 root root 0 Feb 16 18:48 1.txt
[root@localhost tmp]# lsattr
----i----------- ./1.txt
[root@localhost tmp]# rm -f 1.txt
rm: cannot remove ‘1.txt’: Operation not permitted
[root@localhost tmp]#