Linux 权限组

4

我正在尝试设置我的Web服务器,以便一个组可以访问文件。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:无法访问。拒绝权限
[tom@166 httpdocs]$ sudo ls -al
总用量 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
...

2
这个问题可能应该在http://serverfault.com上提问。 - brettkelly
同意。投票移动到ServerFault。 - Randolpho
2个回答

2

需要注意的一点是,当您更改用户组成员资格时,您将需要注销并重新登录(即,组成员资格将在您登录时生效,否则通常不会更改)。


2

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接