文件读取其他内容的权限'不起作用

发布于 2025-02-13 04:14:08 字数 345 浏览 0 评论 0原文

我正在尝试将LightTPD访问日志文件的读取权限给同一系统上的普通用户。 权限当前是:

-RW-R--R-- 1 www-data www-data 211k 25 Feb 28 11:27/var/log/lighttpd/access.log

,如果我正确理解其他人已阅读权限。不幸的是,这似乎不起作用。如果我尝试使用一个用户帐户读取此文件,我会得到:

/var/log/lighttpd/access.log:允许拒绝

我已经尝试将用户添加到www-data的组www-data,而不是T也工作。 有提示我在这里做错了什么?

I'm trying to give read permissions to lighttpd access logfiles to normal users which are on the same system.
The permissions are currently:

-rw-r--r-- 1 www-data www-data 211K Feb 28 11:27 /var/log/lighttpd/access.log

So, if I understood correctly others have read permissions. Unfortunately this doesn't seem to work. If I try to read this file with an user account I get:

/var/log/lighttpd/access.log: Permission denied

I already tried to add the user to the group www-data which didn't work as well.
Any hints what I'm doing wrong here?

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

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

发布评论

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

评论(2

银河中√捞星星 2025-02-20 04:14:08

要访问文件,系统需要在包含文件的所有目录上执行execute权限。

在这种情况下,有必要发布chmod O+X/var/log/ligthttps命令(确保用户属于权限集的“其他”部分之后)。

目录的“执行”权限允许您输入它。目录的“读取”权限使您可以看到内部文件的名称。有趣的是,您可以单独提供X权限,这意味着任何人都可以访问内部的文件,但他需要知道其名称。

To access a file, the system needs the execute permission on all the directories containing the file.

In this case it was necessary to issue the chmod o+x /var/log/lighthttps command (after making sure that the user belongs to the "other" part of the permission set).

The "execute" permission for a directory allows you to enter it. The "read" permission for the directory allows you to see the names of the files inside. The interesting thing is that you can give the x permission alone, what means that anyone can access the files inside, but he needs to know its names.

虐人心 2025-02-20 04:14:08

您可能没有执行LightHTTPD的权限,因此目录未授予访问其包含文件的权限。

使用该命令将执行权限设置为该目录。

chmod +x /var/log/lighthttpd 

You might not have execute permission for the lighthttpd so the directory does not give the permission to access its containing file.

Use the command to set the execute permission to that directory.

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