Linux权限组

发布于 2024-07-27 18:56:46 字数 587 浏览 2 评论 0原文

我正在尝试设置我的网络服务器,以便一组可以访问这些文件。 Apache 和每个需要编辑文件的用户都将属于该组。 所以我将所有文件设置为具有 psacln 组。 我已将 psacln 添加到我的组中。 但它仍然不允许我查看文件:

[tom@166 httpdocs]$ whoami
tom
[tom@166 httpdocs]$ groups tom
tom : tom adm wheel apache psacln andy
[tom@166 httpdocs]$ ls -al
ls: .: Permission denied
[tom@166 httpdocs]$ sudo ls -al
total 92
d---rwx--- 14 andy   psacln 4096 Jul 22 17:51 .
drwxrwxr-x 16 apache apache 4096 Jul 21 09:29 ..
d---rwx---  4 andy   psacln 4096 Jul 21 09:26 backend
d---rwx---  3 andy   psacln 4096 Jul 22 15:21 core
d---rwx---  5 andy   psacln 4096 Jul 21 09:26 css
...

I am trying to setup my webserver so that one group will have access to the files. Apache and every user that needs to edit the files will be part of this group. So I've set all the files to have the group psacln. I've added psacln to my groups. But it still won't let me view the files:

[tom@166 httpdocs]$ whoami
tom
[tom@166 httpdocs]$ groups tom
tom : tom adm wheel apache psacln andy
[tom@166 httpdocs]$ ls -al
ls: .: Permission denied
[tom@166 httpdocs]$ sudo ls -al
total 92
d---rwx--- 14 andy   psacln 4096 Jul 22 17:51 .
drwxrwxr-x 16 apache apache 4096 Jul 21 09:29 ..
d---rwx---  4 andy   psacln 4096 Jul 21 09:26 backend
d---rwx---  3 andy   psacln 4096 Jul 22 15:21 core
d---rwx---  5 andy   psacln 4096 Jul 21 09:26 css
...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

〃温暖了心ぐ 2024-08-03 18:56:46

需要注意的一件事可能有用,那就是当您更改用户的组成员身份时,您将必须注销并再次登录(即组成员身份将在您登录时生效,否则通常不会更改)。

One thing that may be useful to note, is that when you change a user's group membership, you will have to log out and back in again (i.e. group memberships will take effect when you log in and don't normally change otherwise).

别理我 2024-08-03 18:56:46

您可以登录并退出以使组更改生效,或者使用 newgrp 命令更改您的“活动”组也可以为您完成此操作。

You can either log in and out to let the group change take effect, or changing your "active" group with the newgrp command will also do this for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文