简体   繁体   English

linux权限组

[英]linux permission group

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. Apache和每个需要编辑文件的用户都将成为该组的一部分。 So I've set all the files to have the group psacln. 所以我已经将所有文件设置为组psacln。 I've added psacln to my groups. 我已将psacln添加到我的群组中。 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
...

可能需要注意的一件事是,当您更改用户的组成员身份时,您将不得不退出并重新登录(即,当您登录时组成员身份将生效,否则通常不会更改)。

您可以登录和注销以使组更改生效,或者使用newgrp命令更改“活动”组也可以为您执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM