什么可以覆盖 Linux 目录的组权限?
我以 user1 身份登录,grp1 是我的辅助组之一。那么为什么我无法访问 grp1 具有读取权限的文件夹呢?
[user1@machine ~]$ groups user1
user1 : user1 users grp1
[user1@machine ~]$ sudo ls -ld /etc/httpd/logs
drwxr-x--- 4 root grp1 4096 Sep 11 03:59 /etc/httpd/logs
[user1@machine ~]$ ls /etc/httpd/logs
ls: /etc/httpd/logs: Permission denied
I am logged in as user1, and grp1 is one of my secondary groups. So why would I not be able to access a folder on which grp1 has read permissions?
[user1@machine ~]$ groups user1
user1 : user1 users grp1
[user1@machine ~]$ sudo ls -ld /etc/httpd/logs
drwxr-x--- 4 root grp1 4096 Sep 11 03:59 /etc/httpd/logs
[user1@machine ~]$ ls /etc/httpd/logs
ls: /etc/httpd/logs: Permission denied
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通过运行
id
检查您当前是否在该组中 - 如果您在添加该组成员身份后尚未登录(或 su'ed),则您将无法还没有。Check whether you are currently in that group by running
id
- if you haven't logged in (or su'ed) since adding that group membership, you won't have it yet.请检查您是否有父目录的读取权限
Please check if you have read permission to parent DIR
您可以在写入与 grp1 共享的文件之前设置组:
新grp grp1
You can set the group before writing a file shared with grp1:
newgrp grp1