温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

云计算学习路线课程大纲资料:文件属性 chattr

发布时间:2020-08-11 14:49:10 来源:ITPUB博客 阅读:146 作者:千锋云计算 栏目:云计算

给大家分享一些云计算学习路线课程大纲资料,这篇文章是关于文件属性 chattr的一些资料,希望能给大家一些帮助:

云计算学习路线课程大纲资料:文件属性 chattr

文件权限管理之: 文件属性

注:设置文件属性(权限),针对所有用户,包括root

[root@tianyun ~]# touch file100 file200

[root@tianyun ~]# lsattr file100 file200

-------------e- file100

-------------e- file200

[root@tianyun ~]# man chattr att属性

[root@tianyun ~]# chattr +a file100

[root@tianyun ~]# chattr +i file200

[root@tianyun ~]# lsattr file100 file200

-----a-------e- file100 a属只能够追加 不可以写

----i--------e- file200

[root@tianyun ~]# echo 111 > file100 //以覆盖的方式写入 

bash: file100: Operation not permitted

[root@tianyun ~]# rm -rf file100

rm: cannot remove `file100': Operation not permitted

[root@tianyun ~]# echo 111 >> file100 //以追加的方式写入,例如日志文件 适用于日志

[root@tianyun ~]# echo 111 > file200 i 属性 不可以改变文件 适用于 /etc/suders /passwd 文件只能看

bash: file200: Permission denied

[root@instructor ~]# echo 111 >> file200

bash: file200: Permission denied

[root@tianyun ~]# rm -rf file200

rm: cannot remove `file200': Operation not permitted

[root@tianyun ~]# chattr -a file100

[root@tianyun ~]# chattr -i file200


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI