- 1
- 0
- 约4.69千字
- 约 5页
- 2022-07-04 发布于福建
- 举报
FACL 文件系统的权限设置
FACL 文件系统的权限设置 (file access contrl list) 文件访问控制列表
针对 Unix 系统权限机制的不足,一个名为 POSIX ACL 的全新权限机制诞生了,目的就是为了给各
Unix 系统之间制定一个兼容的 ACL 标准,使得各操作系统之间使用统一的接口。 ACL 为现有权限机
制的延伸,在现有机制的三个基本设定 (owner 、group 、other) 的基础上加入了对某指定使用者或群
组的存取权限设定。
在 Linux Kernel 2.6 上已经正式支持 POSIX ACL ,常用的档案系统 (如:ext2,ext3,xfs,jfs 以及 ReiserFS)
都能使用 ACL 。当然,在编译 kernel 时需要启动 ACL 。
相关的 kernel option:
CONFIG_FS_POSIX_ACL
CONFIG_EXT3_POSIX_ACL
CONFIG_EXT2_POSIX_ACL
rules:
user:(uid/name):(perms) 指定某位使用者的权限
group:(gid/name):(perms) 指定某一群组的权限
other::(perms) 指定其它使用者的权限
mask::(perms) 设定有效的权限屏蔽
ACL 可以对某个文件设置该文件具体的某些用户的权限 ,意思就是通过 ACL 可以对一个文件权限做扩
展,可以不同的用户对某个文件有不同的权限。
option:
-m 新增或修改 ACL 中的规则
-x 移出 ACL 中的规则
getfacl 文件名 获取文件的访问控制信息
setfacl 设置文件的 acl -m 修改文件的 acl -x 取消对文件的设置
setfacl –m u: 用户名 :权限 文件名
setfacl –m g: 组名 :权限 文件名
要设定预设型 ACL 只需在每个规则前加上 default: 。
例如: setfacl -m default:user::rw /home/alex
或简写为: setfacl -m d:u::rw /home/alex
[root@haha ~]# getfaclhello_world 查看文件的 acl 权限
# file: hello_world
# owner: root
# group: root
user::rw-
group::r--
other::r--
[root@haha ~]# setfacl -m student:rwxhello_world 让用户 student 拥有 rwx 权限
[root@haha ~]# getfaclhello_world
# file: hello_world
# owner: root
# group: root
user::rw-
user:student:rwx
group::r--
mask::rwx
other::r--
[root@haha ~]# setfacl -m g:student:rx hello_world 让组 student 拥有 rwx 权限
[root@haha ~]# getfaclhello_world
# file: hello_world
# owner: root
# group: root
user::rw-
user:student:rwx
group::r--
group:student:r-x
mask::rwx
other::r--
[root@haha ~]# llhello_world
-rw-rwxr —+ 1 root root 0 07-21 13:48 hello_world
[root@haha ~]# setfacl -x student hello_world 解除 student 用户对文件的 acl 权限
[root@haha ~]#
您可能关注的文档
最近下载
- 鸿宝HB-S9说明书中文版.pdf VIP
- 城镇智慧水务平台初步设计方案[30页word].docx VIP
- 心育故事——爱是教育的源泉.doc VIP
- 华东国际联运港智慧物流园项目可研报告.pdf
- (完整)铁路通信工题库技能鉴定高级(现场综合维护) .pdf VIP
- HOLLiAS 北京和利时功能块说明.pdf VIP
- 2025年度民主生活会个人“五个带头”方面对照检查发言提纲(强化政治忠诚、固本培元、三个敬畏、干事创业、管党治党).docx VIP
- 医院科室安全生产检查表.docx VIP
- 2024年一级建造师《水利实务》考前10页纸总复习.pdf VIP
- 百色芒果栽培护理工作月历.doc VIP
原创力文档

文档评论(0)