需要将*nix系统上的权限更改为777

发布于 2024-08-01 21:41:36 字数 330 浏览 7 评论 0原文

有一个文件夹和文件如下:

Folder:
drwxrwxrwx   3 me  153157   8 Aug 17 14:17 Nugget
File within Nugget:
...
-rw-rw-r--   1 web  web       24 Aug 17 14:17 nugget.php

我需要根据文档将 nugget.php 的权限更改为 777。

$ chmod 777 nugget.php
chmod: nugget.php: Operation not permitted

建议?

Have a folder and files as follows:

Folder:
drwxrwxrwx   3 me  153157   8 Aug 17 14:17 Nugget
File within Nugget:
...
-rw-rw-r--   1 web  web       24 Aug 17 14:17 nugget.php

I need to change permissions on nugget.php to 777 as per the documentation.

$ chmod 777 nugget.php
chmod: nugget.php: Operation not permitted

Suggestions?

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

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

发布评论

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

评论(4

咿呀咿呀哟 2024-08-08 21:41:36

您可以以 root 身份执行此操作,但我建议您先坐下来考虑一下。 任何有权访问您计算机的人都可以以任何方式更改此文件。 破解者通过查找此类文件并滥用它们来获得报酬。

通常,您的问题是 Web 应用程序需要读取该文件,并且某些用户需要能够写入该文件。 在这种情况下,将文件chown给用户,并将组保留为web,并将权限设置为640(本地用户可以读+写) ,网页只能读取)。

You could do this as root but I suggest to sit back and think about it for a moment. Anyone with access to your computer will be able to change this file in any way. Crackers get paid money to find files like that and abuse them.

Usually, your problem is that the web app needs to read the file and some user needs to be able to write it. In this case, chown the file to the user and leave the group as web and set the permissions to 640 (local user can read+write, web can only read).

寂寞笑我太脆弱 2024-08-08 21:41:36

除非您在网络组中,否则您无权写入该文件。 如果您拥有该系统,则可以使用 sudo 来完成您的需要。 但是,如果您有 sudo 访问权限,您可能就不会问了。

由于您拥有该目录,因此您可以删除该文件。 因此,一种解决方法是:将文件文本保存在其他位置(在另一个窗口中)。 删除文件。 在编辑器中重新创建文件,粘贴文本。 节省。 应该可以做到这一点。 但是,由于这是一个脚本,因此执行此操作可能会破坏脚本(它可能需要以用户“web”身份运行)。

最安全的选择是要求系统管理员将您添加到“web”组,或者让他或她将文件组更改为您所在的组。

Unless you are in group web, you do not have permissions to write that file. If you own the system, you can use sudo to accomplish what you need. However, if you had sudo access, you probably wouldn't be asking.

Since you own the directory, you can delete the file. So one workaround would be: save the text of the file somewhere else (in another window). Delete the file. Recreate the file in an editor, pasting in the text. Save. That should do it. However, it's possible since this is a script that doing this would break the script (it might need to run as user 'web').

The safest alternative is to ask the system administrator to add you to the group "web", or else to have him or her change the group of the file to a group that you are in.

血之狂魔 2024-08-08 21:41:36

您的帐户(您登录的帐户)似乎没有该文件的权限。

它属于“web”,并且您没有以该用户或该组的身份登录。 非所有者或不属于 Web 组的帐户对该文件的权限列为“r--”,这意味着您登录的帐户只能读取该文件。

因此,以 root 或“web”身份登录并执行相同的操作。

Your account (the one you logged in as) does not seem to have permissions on that file.

It's owned by "web", and you're not logged in as that user or that group. The permissions on that file for accounts that are not the owner or that do not belong to the web group are listed as "r--", which means the account that you logged in as can only read it.

So, login as root or "web" and perform the same operations.

寄与心 2024-08-08 21:41:36

sudo chmod 777 nugget.php ??

sudo chmod 777 nugget.php ??

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