-
基本权限 ACL
-
区别
-
请思考:使用chmod能针对独立用户设置文件不同的权限吗? user01 rwx file1 user02 rw file1 user03 r file1 user04 rwx file1 user05 rw file1
-
ACL文件权限管理: 设置不同用户,不同的基本权限(r、w、x)。对象数量不同。 UGO设置基本权限: 只能一个用户,一个组和其他人
-
-
语法
-
setfacl -m u:alice:rw /home/test.txt
-
命令 设置 用户或组:用户名:权限 文件对象
-
-
用法
-
设置
-
准备文件
-
[root@localhost ~]# touch /home/test.txt [root@localhost ~]# ll /home/test.txt -rw-r--r-- 1 root root 0 10-26 13:59 /home/test.txt
-
-
设置ACL
-
查看文件有哪些ACL权限。
-
[root@localhost ~]# getfacl /home/test.txt
-
-
设置用户alice,jack权限
-
前提:创建alice 和jack用户。过程略
-
[root@localhost ~]# setfacl -m u:alice:rw /home/test.txt [root@localhost ~]# setfacl -m u:jack:- /home/test.txt
-
-
请思考命令中的o是什么作用
-
[root@localhost ~]# setfacl -m o::rw /home/test.txt
-
-
-
查看/删除:
-
查看ACL
-
[root@localhost ~]# getfacl /home/test.txt
-
getfacl: Removing leading '/' from absolute path names 查看文件权限,删除了根路径。 # file: home/test.txt 文件名 # owner: root 属主:root # group: root 属组:root user::rwx 用户:属主:rwx user:alice:rw- 用户:alice:rw- user:jack:--- 用户:jack:--- group::rwx 组:属组:rwx mask::rwx 掩码::rwx other::rwx other:其他人:rwx
-
-
-
删除ACL
-
设置
-
增加hr组对test.txt文件读取的权限
-
[root@localhost ~]# setfacl -m g:hr:r /home/test.txt
-
-
删除部分
-
[root@localhost ~]# setfacl -x g:hr /home/test.txt
-
//删除组hr的acl权限
-
-
-
删除所有
-
[root@localhost ~]# setfacl -b /home/test.txt
-
//删除所有acl权限
-
-
-
-
-
-
-
用户的权限(中)基本权限 ACL
最新推荐文章于 2024-09-15 22:47:38 发布
本文介绍了Linux中基本权限ACL的区别,包括chmod和setfacl命令的使用,如何为不同用户和组设置文件权限,以及UGO设置的限制。通过实例展示了如何操作和管理test.txt文件的ACL权限,包括添加、删除和查看权限的过程。
摘要由CSDN通过智能技术生成