简体   繁体   English

创建 Linux 用户以访问具有 rwxrwS- (2760) 权限的文件夹

[英]Create Linux user to access folder with rwxrwS— (2760) permissions

I have a folder that has permissions set to 2760. The folder seems to be owned by www-data user and group.我有一个权限设置为 2760 的文件夹。该文件夹似乎归www-data用户和组所有。

drwxrwS---  2 www-data www-data  196 Dec 5 19:52 folder

I added new user to www-data group, but it still cant access the folder without modifying permissions on the folder?我将新用户添加到www-data组,但如果不修改文件夹的权限,它仍然无法访问该文件夹?

How can I modify the user to allow it to read that folder?如何修改用户以允许其读取该文件夹?

I tried re-logging in, but it still doesn't let the user view the folder.我尝试重新登录,但它仍然不允许用户查看该文件夹。

I just need this user to be able to read / download the files from that folder.我只需要这个用户能够读取/下载该文件夹中的文件。

UPDATE:更新:

Added out put of:添加输出:

getfacl folder

Output: Output:

# file: folder
# owner: www-data
# group: www-data
# flags: -s-
user::rwx
group::rw-
other::---

With the mode 2760 , resp.使用模式2760 ,分别。 drwxrwS--- , the group has permission to read and write the directory, but can not access anything inside the directory (because the executable bit is missing). drwxrwS--- ,该组有权读写目录,但不能访问目录内的任何内容(因为缺少可执行位)。 You likely want to use 2770 , resp.您可能想使用2770 ,分别。 drwxrws--- instead. drwxrws---代替。

The setgroup-id bit is not important when reading files as (in this case, ie, when set on a directory), it affects the default group of newly created files within the directory. setgroup-id 位在读取文件时并不重要(在这种情况下,即在目录上设置时),它会影响目录中新创建文件的默认组。 Instead of using the primary group of the current user, new files will be created with the group set to the group of the parent directory (if allowed)将创建新文件,而不是使用当前用户的主组,并将组设置为父目录的组(如果允许)

With that being said, if you only want the owner to add files and members of the group to read files from the directory, you can simply use mode 0750 , resp.话虽如此,如果您只希望所有者添加文件和组成员从目录中读取文件,您可以简单地使用模式0750 ,resp。 rwxr-x--- on your directory. rwxr-x---在您的目录中。

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

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