zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    C# 中==和Equal的区别
    3dmath复习随笔
    3dmax学习资料记录
    [官方教程] Unity 5 BLACKSMITH深度分享
    [技术] [插件精选] 炫酷粒子特效(下)
    Unity3D总结:关于射线碰撞
    Unity3D将来时:IL2CPP(上)
    3DMAX 9 角色建模3 uv展开
    php,c# hamsha1
    U3D 的一些基础优化
  • 原文地址:https://www.cnblogs.com/anttech/p/10597588.html
Copyright © 2011-2022 走看看