LINUX额外权限控制ACL

本文发布时间: 2019-Mar-21
ACL 是Access Control List 的缩写。主要的目的是提供传统的OWNER,GROUP,OTHER的read,wirite,execute权限之外的权限设定。ACL可以针对一个文档、目录进行R,W,X的权限设定。getfacl:获取某个文档、目录的ACL设定项目。setfacl:设定某个文档、目录的ACL项目。例子:##创建一个文件[jimistephen@localhost acl]$ touch acl_test##列出文件的属性、权限[jimistephen@localhost acl]$ ll acl_test-rw-rw-r--. 1 jimistephen jimistephen 0 Mar 10 08:21 acl_test#修改文档的权限[jimistephen@localhost acl]$ setfacl -m u:jimi:rx acl_test#查看修改后的权限[jimistephen@localhost acl]$ ll acl_test-rw-rwxr--+ 1 jimistephen jimistephen 0 Mar 10 08:21 acl_test##修改权限的时候,没有使用者的列表,代表该文件的拥有者。[jimistephen@localhost acl]$ setfacl -m u::rwx acl_test[jimistephen@localhost acl]$ ll acl_test-rwxrwxr--+ 1 jimistephen jimistephen 0 Mar 10 08:21 acl_test#获取文件信息与权限。[jimistephen@localhost acl]$ getfacl acl_test# file: acl_test #文件名# owner: jimistephen #文件的拥有者# group: jimistephen #文件属性用户组user::rwx #文件拥有者的权限user:jimi:r-x #针对特定用户设定的权限 jimi 权限有r,xgroup::rw- #文件的群组拥有的权限mask::rwx #文件预设的有效权限other::r-- #其它人拥有的权限额外说明:#这个只是改变了当前目录的权限setfacl -m u:myuser1:rx /srv/projecta#如果要实现这个目录下面的所有文件、目录都继承权限可以使用下面进行设置setfacl -m d:u:myuser1:rx /srv/projecta


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:08pm
栏目列表