linux权限管理之文件属性
文件属性 chattr
========================================================
文件权限管理之: 文件属性
注:设置文件属性(权限),针对所有用户,包括root
[root@localhost ~]# touch file100 file200 file300
[root@localhost ~]# lsattr file100 file200 file300
-------------e- file100
-------------e- file200
-------------e- file300
[root@localhost ~]# man chattr
[root@localhost ~]# chattr +a file100
[root@localhost ~]# chattr +i file200
[root@localhost ~]# chattr +A file300
[root@localhost ~]# lsattr file100 file200 file300
-----a-------e- file100
----i--------e- file200
-------A-----e- file300
[root@localhost ~]# echo 111 > file100 //以覆盖的方式写入
bash: file100: Operation not permitted
[root@localhost ~]# rm -rf file100
rm: cannot remove `file100': Operation not permitted
[root@localhost ~]# echo 111 >> file100 //以追加的方式写入,例如日志文件
[root@localhost ~]# echo 111 > file200
bash: file200: Permission denied
[root@instructor ~]# echo 111 >> file200
bash: file200: Permission denied
[root@localhost ~]# rm -rf file200
rm: cannot remove `file200': Operation not permitted
[root@localhost ~]# chattr -a file100
[root@localhost ~]# chattr -i file200
[root@localhost ~]# chattr -A file300
最新文章
- 张小龙宣布微信小程序1月9日发布,并回答了大家最关心的8个问题
- Nginx+Tomcat+Redis实现负载均衡、资源分离、session共享
- Cocos2d-x 3.2 学习笔记(五)Sprite Node
- “K米” 软件产品评测
- 修改ubuntu DNS的步骤/wget url报错: unable to resolve host address的解决方法
- 烂泥:KVM安装centos6.5系统
- 第一篇 SQL Server代理概述
- 全注解的SSH框架
- UVa 400 Unix Is
- MySQL字符串类型转换时间类型
- 157. Read N Characters Given Read4
- Solr集群的搭建以及使用(内涵zookeeper集群的搭建指南)
- JS 导出图片,toDataURL
- web前端学习就这9个阶段,你属于哪个阶段?
- 视频直播技术(七):Ijkplayer切换网络时停止播放的问题处理
- EasyUI中tree,Datagrid,pagenation的使用EasyUI中Datagrid和pagenation进行关联时,再次点击pagenation时让表格数据显示的问题
- STM32F103 ------ BOOT0 / BOOT1
- django自定制Admin
- SharpSvn 调用在运行时提示加载程序集出错,或有依赖项
- 【Unity】6.4 Transform--移动、旋转和缩放游戏对象
热门文章
- git克隆源码时提示fatal: HTTP request failed怎么办?
- 设计模式总结(转自CS-Notes)
- 未能加载文件或程序集“System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKe
- P3273 [SCOI2011]棘手的操作
- 题解—— 洛谷 p1993 小K的农场(差分约束&;负环判断)
- Python实现机器学习算法:线性回归
- 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题
- algorithm.sty not found error in LaTeX 解决方法
- 【译】第37节---EF6-异步查询和保存
- 五、IO编程