Base permission mode: file 666, dir 777, for UGO, will effected by the umask and ACL.

Umask: 022 without write, for will affect the base permission mode. UGO, not owner.

Default acl: specific U/G, without Owner and Group. Is not effected by the base permission and umask.

Mask: effect the specific user and group from acl set,

       1. won't limit the owner.
       2. won't affect the UGO.
       3. won't be effected by the umask.

        high privilege

Set ACL: is effected by the mask

root@DTBOSCLI2563213:/mnt # mkdir dir3
root@DTBOSCLI2563213:/mnt # touch file3

root@DTBOSCLI2563213:/mnt # ls -l file3
-rw-r--r--. 1 root root 0 Jun 25 05:57 file3

root@DTBOSCLI2563213:/mnt # ls -l
drwxr-xr-x. 2 root root 1024 Jun 25 05:56 dir3

root@DTBOSCLI2563213:/mnt # getfacl file3

file: file3

owner: root

group: root

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

root@DTBOSCLI2563213:/mnt # getfacl dir3

file: dir3

owner: root

group: root

user::rwx
group::r-x
other::r-x

root@DTBOSCLI2563213:/mnt # umask
0022

file3 base permission 666, 受到umask 影响, owner不变 "rw",group 和 other 受到umask影响,去掉了w,变成了644 "rw-r--r--".

dir3 base permission 777, 受到umask 影响, owner 不变"rwx", group 和 other 受到mask 影响,去掉了w, 变成755 “rwxr-xr-x”

设置default acl , 会默认补全default UGO(与现有UGO 保持一致)。
mask通常被设置为能够覆盖您为任何用户或组指定的最高权限。
如果以后更改或添加更高的权限给其他用户或组,mask可能会自动调整来反映这些变化。
这是为了确保mask总是足够高,能够不限制任何通过ACL设置的权限。

root@DTBOSCLI2563213:/mnt # setfacl -d --set g:testg1:rwx dir3

root@DTBOSCLI2563213:/mnt # ls -l
total 22
drwxr-xr-x+ 2 root root 1024 Jun 25 05:56 dir3

root@DTBOSCLI2563213:/mnt # getfacl dir3

file: dir3

owner: root

group: root

user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:testg1:rwx
default😷:rwx
default:other::r-x

在dir3下创建file, 首先继承default acl UGO: rwxr-xr-x
然后受到basic permission 约束666, 变成 rw-r--r--
再受umask022影响 变成: rw-r--r--
最终 UGO: rw-r--r--

由于特别指定了group:group:testg1:rwx,
ACL为testg1组明确指定了rwx,而mask限制了这个权限至rw-。

• 在新文件创建时,操作系统会重新计算一个合适的mask,以确保通过ACL设置的权限不超出basic permission(即基本权限和ACL的交集)。

ask被设置为rw-而不是rwx,主要是因为它需要保证通过ACL设置的权限不会超出文件的basic permission 范围。

虽然testg1组通过ACL被指定了rwx,但因为新文件的基本权限只有rw-r--r--,所以mask被调整以反映这一点,即最大允许的权限是rw-

如果是directory, 基本权限范围是 rwxr-xr-x, 最大rwx.

root@DTBOSCLI2563213:/mnt # touch dir3/subfile3

root@DTBOSCLI2563213:/mnt # ls -l dir3/
total 1
-rw-rw-r--+ 1 root root 0 Jun 25 06:19 subfile3

root@DTBOSCLI2563213:/mnt # getfacl dir3/subfile3

file: dir3/subfile3

owner: root

group: root

user::rw-
group::r-x #effective:r--
group:testg1:rwx #effective:rw-
mask::rw-
other::r--

root@DTBOSCLI2563213:/mnt # getfacl dir3/subdir3/

file: dir3/subdir3/

owner: root

group: root

user::rwx
group::r-x
group:testg1:rwx
mask::rwx
other::r-x
default:user::rwx
default:group::r-x
default:group:testg1:rwx
default😷:rwx
default:other::r-x

posted @ 2024-06-25 15:23 vivi~ 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 在Windows系统中,安全描述符(SD)和访问控制列表(ACL)是用来管理文件和目录的安全和权限的两个重要概念。它们之间既有区别也有联系。下面是对这两个概念的详细解释: 安全描述符(Security Descriptor, SD) 安全描述符是一个结构,它包含了与对象(如文件、目录、进程等)相关的 阅读全文
posted @ 2024-06-23 18:11 vivi~ 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 文件系统格式 windows: FAT, NTFS; Linux: ext, ext1/2/3/4, xfs; 网络: NFS, SMB(samba SMB/CIFS) 云: VFS: Linux & Mac OS 在文件系统之上虚拟出一层文件系统,Virtual FS; POSIX: portab 阅读全文
posted @ 2024-06-23 14:02 vivi~ 阅读(116) 评论(3) 推荐(1) 编辑
摘要: pathlib.Path("a.crt").write_text(a[0]) p.chmod(0o444) Path.cwd() p.write_bytes(b'Binary file contents') p.read_bytes() Path('setup.py').exists() class 阅读全文
posted @ 2024-06-07 15:33 vivi~ 阅读(8) 评论(0) 推荐(0) 编辑
摘要: k8s-ConfigMap Configure a Pod to Use a ConfigMap Create a ConfigMap Create a ConfigMap from a directory 读取configmap内容并以yaml格式输出 create configmap from 阅读全文
posted @ 2024-01-28 20:55 vivi~ 阅读(15) 评论(0) 推荐(0) 编辑
摘要: Scale the app Scaling will increase the number of Pods to the new desired state. Pre-config: expose the app publicly kubectl get services NAME TYPE CL 阅读全文
posted @ 2024-01-24 21:45 vivi~ 阅读(29) 评论(0) 推荐(0) 编辑
摘要: k8s kubelet (Kubernetes node agent): 是运行在每个节点上的代理,负责管理该节点上的容器, 它从 Kubernetes Master 接收 Pod 的描述,并确保节点上运行的容器与描述一致。不能跨节点。 kubelet 的主要作用是保证节点上的容器按照期望的状态运行 阅读全文
posted @ 2024-01-24 15:17 vivi~ 阅读(37) 评论(0) 推荐(0) 编辑
摘要: RKEv2: rolling upgrades, zero downtime upgrade, and automatic etcd backups. Variety of network plugins and has built-in support for the Helm package m 阅读全文
posted @ 2024-01-21 20:46 vivi~ 阅读(10) 评论(0) 推荐(0) 编辑
摘要: MetalLB: route TCP or UDP traffic (layer 4). Ingress: is based on the HTTP or HTTPS (layer 7), using NGINX or HAProxy. Once MetalLB is installed, the 阅读全文
posted @ 2024-01-21 19:52 vivi~ 阅读(9) 评论(0) 推荐(0) 编辑
摘要: tox.ini 来做配置文件, 在tox.ini配置[testenv:dev],可以执行tox -e dev,完成指定虚拟环境dev的test。 tox -e pep8 #对代码进行检查 tox -e py27 #构建测试环境 环境切换 _MAPPING = { 'dev': DevConfig, 阅读全文
posted @ 2022-12-30 19:24 vivi~ 阅读(190) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示