lattr与chattr
linux系统对普通许可和文件都赋予特定属性,使用lsattr命令显示文件属性,使用chattr修改文件属性;
lattr
ATTRIBUTES
A file with the 'a' attribute set can only be open in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear
this attribute.
在文件中添加、删除a属性。即只可以添加文件内容,但即使是超级用户也不能删除文件;
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.
在文件中添加/删除i属性,任何人均不可以删除,修改,重命名,连接到这个文件,除非超级用户或者执行CAP_LINUX_IMMUTABLE 能力,改变这个属性;