chattr lsattr linux file system attributes - linux 文件系统扩展属性
我们使用 linux 文件系统定义的文件属性,能够对linux文件系统进行进一步保护;从而给文件 赋予一些额外的限制;在有些情况下,能够对我们的系统提供保护;
该命令特定用于 linux extended filesystem (ext2, ext3, ext4),是e2fsprogs 工具的一部分;而e2fsprogs 工具包,包含了创建,检查和维护ext2/3/4-based 文件系统的工具。其也包含badblocks等用于检查文件系统坏块的工具。
chattr命令用来改变文件属性。这项指令可改变存放在ext2文件系统上的文件或目录属性,这些属性共有以下8种模式:详细作用,可以查看man手册;注意该属性不是linux文件系统扩展属性。
a:让文件或目录仅供附加用途;
b:不更新文件或目录的最后存取时间;
c:将文件或目录压缩后存放;
d:将文件或目录排除在倾倒操作之外;
i:不得任意更动文件或目录;
s:保密性删除文件或目录;
S:即时更新文件或目录;
u:预防意外删除。
lsattr - list file attributes on a Linux second extended file system
比如你可以给 /etc/passwd 文件进行修改,这样就是连root用户都不能更改它的代码;
Attribute | lsattr flag | chattr option | Semantics and rationale |
---|---|---|---|
Compressed dirty file | Z |
(unavailable) |
|
Compression raw access | X |
(unavailable) |
|
Undeletable | u |
+u to set-u to clear[note 2] |
|
Top of directory hierarchy | T |
+T to set-T to clear |
|
No tail-merging | t |
+t to set-t to clear |
|
Synchronous updates | S |
+S to set-S to clear |
|
Secure deletion | s |
+s to set-s to clear[note 2][note 5] |
|
Data journaling | j |
+j to set-j to clear[note 4] |
|
Indexed directory | I |
(unavailable) |
|
Immutable | i |
+i to set-i to clear[note 1] |
|
Huge file | h |
(unavailable) |
|
Compression error | E |
(unavailable) |
|
Extent format | e |
(unavailable) |
|
Synchronous directory updates | D |
+D to set-D to clear |
|
No dump | d |
+d to set-d to clear |
|
No Copy-on-Write (CoW) | C |
+C to set-C to clear[note 3] |
|
Compressed | c |
+c to set-c to clear[note 2] |
|
No atime updates |
A |
+A to set-A to clear |
|
Append only | a |
+a to set-a to clear[note 1] |
|
Version / generation number | -v |
-v version |
|
参考链接:
https://en.wikipedia.org/wiki/Chattr (上述表格来自于此)
http://c.biancheng.net/view/874.html
https://www.runoob.com/linux/linux-comm-chattr.html
https://www.runoob.com/linux/linux-comm-lsattr.html
https://www.cnblogs.com/ftl1012/p/chattr.html
保持更新,更多内容请关注 cnblogs.com/xuyaowen; 获取更多内容;
关于文件系统扩展属性内容,请参考:Linux 文件系统扩展属性
chattr lsattr linux file system attributes - linux 文件系统扩展属性的更多相关文章
- Linux 文件系统扩展属性【转】
转自:https://blog.csdn.net/ganggexiongqi/article/details/7661024 扩展属性(xattrs)提供了一个机制用来将<键/值>对永久地 ...
- linux中suid/sgid/sticky及扩展属性(attr)
suid只适用于命令文件.(如/usr/bin/passwd) 当命令文件上有suid权限时,则操作用户的权限变成属主权限.命令文件上无suid权限则操作用户的权限不变. 查看suid权限: [roo ...
- 磁盘、分区及Linux文件系统 [Disk, Partition, Linux File System]
1.磁盘基础知识 1.1 物理结构 硬盘的物理结构一般由磁头与碟片.电动机.主控芯片与排线等部件组成:当主电动机带动碟片旋转时,副电动机带动一组(磁头)到相对应的碟片上并确定读取正面还是反面的碟面,磁 ...
- Linux File System Change Monitoring Technology、Notifier Technology
catalog . 为什么要监控文件系统 : hotplug . udev . fanotify(fscking all notification system) . inotify . code e ...
- Linux File System
目录 . Linux文件系统简介 . 通用文件模型 . VFS相关数据结构 . 处理VFS对象 . 标准函数 1. Linux文件系统简介 Linux系统由数以万计的文件组成,其数据存储在硬盘或者其他 ...
- changing permissions of Read-only file system in linux
up vote 2 down vote favorite 1 i use this command to make a bootable flash disk of linux mint sudo ...
- key directories in the linux file system
Key directories in the file system: */: Root directory (base of file system) /bin: Executable progra ...
- linux文件系统扩展属性
翻译自man手册,水平有限,有错还望不吝指出.... 扩展属性是与文件和目录相关的name:value对,用来提供文件系统的一些附加功能,例如ACL.对文件或是目录拥有读权限的用户可以看到其扩展属性. ...
- File System 之本地文件系统
上一篇文章提到了,最近做一个基于 File System/IndexedDB的应用,上一篇是定额和使用的查询. 因为LocalFileSystem只有chrome支持,有点尴尬,如果按需加载又何来尴尬 ...
随机推荐
- 集合系列 Map(十二):HashMap
HashMap 是 Map 基于哈希散列算法的实现,其在 JDK1.7 中采用了数组+链表的数据结构.在 JDK1.8 中为了提高查询效率,采用了数组+链表+红黑树的数据结构.本文所有讲解均基于 JD ...
- Jmeter工具使用初体验
一.Jmeter组成部分 一个完整的脚本必须包含以下三项,他们都在测试计划的子选项中,我们直接在测试计划上右键选择即可 线程组 取样器 监视器 二.脚本编写 1.创建线程组 2.添加取样器 我们这里添 ...
- DataGridView使用BindingNavigator实现简单分页功能
接上一篇<DataGridView使用自定义控件实现简单分页功能>,本篇使用BindingNavigator来实现简单分页功能.其实也只是借用了一个BindingNavigator空壳, ...
- 教你用python假装黑客装逼,当着朋友的面破解他的网站密码!
如何破解iphone登陆密码 今天看了一篇关于如何破解iphone手机密码的文章,瞬间觉得科学技术不是第一生产力,why? 根据“可靠消息”称,即便美国FBI也无法轻易的对iphone手机进行暴力破解 ...
- 文本切换器(TextSwitcher)的功能与用法
TextSwitcher继承了ViewSwitcher,因此它具有与ViewSwitcher相同的特征:可以在切换View组件时使用动画效果.与ImageSwitcher相似的是,使用TextSwit ...
- mysql从5.6升级到5.7后出现 Expression #1 of ORDER BY clause is not in SELECT list,this is incompatible with DISTINCT
[问题]mysql从5.6升级到5.7后出现:插入数据和修改数据时出错Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: - ...
- linux常用命令修改权限查看文档
一.>和>>指令 >用于将执行结果写入后面的文件中: 把前方语句的结果存进文件,若文件不存在会自动创建 >:输出重定向 会覆盖原来文件内容 >>:追加重定向 ...
- python连接sqlite3
一.了解sqlite sqlite是一种嵌入式数据库,它的数据库就是一个文件.由于SQLite本身是用C写的,而且体积很小,所以经常被集成到各种应用程序中,甚至在IOS和Android的APP中都可以 ...
- Java面试题和解答(五)
1.在Java中Executor和Executors的区别? Executor是线程池的顶层接口,它的实现类如下图所示: Executors是一个类,提供了多个静态方法,用于生成不同类型的线程池,如下 ...
- kaldi使用thchs30数据进行训练并执行识别操作
操作系统 : Ubutu18.04_x64 gcc版本 :7.4.0 数据准备及训练 数据地址: http://www.openslr.org/18/ 在 egs/thchs30/s5 建立 thch ...