首页 > 系统服务 > 详细

linux acl 一些选项的解释

时间:2016-08-30 01:52:59      阅读:228      评论:0      收藏:0      [点我收藏+]

1,有些朋友经常问,setfacl -X 或者 -M 是怎么用的一个用法,其实和-m , -x 是一个用法,系统文档一般使用,-m , -x 做样例解释,对文件目录添加扩展权限,一般很少-X ,-M去配置文件acl条目,可能对一些用心的初学者朋友,会有点捉急。

  文档里面的解释是: 

      The -m (--modify) and -M (--modify-file) options modify the ACL of a file or directory

      The  -x  (--remove)  and  -X  (--remove-file) options remove ACL entries

2,-M , -X 选项参数是文件 ,就是这样的 ^-^

  例如:配置 一个文件  acl.sh  额外权限 如下

    getfacl --omit-header acl.sh 没有配置acl 权限如下

         user::rw-
         group::r--
         other::r--

    setfacl -m u:user1:rwx acl.sh 配置acl 条目

    getfacl --omit-header acl.sh  配置后的权限

user::rw-
user:user1:rwx
group::r--
mask::rwx
other::r--

使用-M 配置 Acl 规则条目

echo -n ‘u:user1:rw‘ > acl.txt && setfacl -M acl.txt acl.sh

getfacl --omit-header acl.sh 获取如下

user::rw-
user:user1:rw-
group::r--
mask::rw-
other::r-

以上修改acl 条目方法,

删除acl条目是 -x -X

同理上面: 

  setfacl -x u:user1 acl.sh

  echo -n ‘u:user1‘ > acl.txt && setfacl -X acl.txt acl.sh

 

---------------------------------- END -------------------------------------------

 

 

     

linux acl 一些选项的解释

原文:http://www.cnblogs.com/iszhihui/p/5820343.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!