ITPub博客

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

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

原创 Openstack 作者:千锋云计算 时间:2019-08-12 17:45:44 0 删除 编辑

给大家分享一些云计算学习路线课程大纲资料,这篇文章是关于文件属性 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


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69916964/viewspace-2652986/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-18

  • 博文量
    933
  • 访问量
    613370