运行brew会生成警告

发布于 2024-10-09 22:41:42 字数 204 浏览 0 评论 0原文

我在 OS X 10.6.5 上安装了最新的 Homebrew
运行任何命令都会生成此警告:

/usr/local/Library/Homebrew/global.rb:34:警告:路径中不安全的世界可写目录 /usr/local/bin,模式 040777

为什么我收到此警告?以及如何补救?

I installed the latest Homebrew on OS X 10.6.5
Running any command generates this warning:

/usr/local/Library/Homebrew/global.rb:34: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

Why I'm getting this warning? and how to remedy?

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

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

发布评论

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

评论(3

扛起拖把扫天下 2024-10-16 22:41:42

我遇到了同样的问题,只是用这 3 个命令修复了它,大致取自 Homebrew 安装脚本:

sudo chgrp -R admin /usr/local
sudo chmod -R g+rwx /usr/local
sudo chmod -R o-w /usr/local

I had the same problem and just fixed it with these 3 commands, roughly taken from Homebrew installation script:

sudo chgrp -R admin /usr/local
sudo chmod -R g+rwx /usr/local
sudo chmod -R o-w /usr/local
浅语花开 2024-10-16 22:41:42

首先,有两个brew 命令在调试问题时很有帮助。它们是:

$ brew doctor
$ brew missing

其次,Homebrew 告诉您 /usr/local/bin 对谁可以写入该目录的设置过于宽松——这是一个潜在的安全问题。要解决此问题,您可以将权限重置回 Homebrew 预期的权限。

$ chmod 755 /usr/local/bin

如果您在尝试执行此操作时遇到错误,则可能意味着您的 /usr/local 目录(和子目录)属于错误的用户。如果是这种情况,我会考虑删除您的 /usr/local 目录并重新安装 Homebrew < em>正确。或者,您可以通过在最后一个命令前加上 sudo 并输入您的管理员密码来覆盖错误:

$ sudo chmod 755 /usr/local/bin

First, there are two brew commands that are helpful when debugging problems. They are:

$ brew doctor
$ brew missing

Second, Homebrew is telling you that /usr/local/bin is set to be too permissive in who can write to that directory -- a potential security problem. To remedy this, you can reset your permissions back to what Homebrew intended.

$ chmod 755 /usr/local/bin

If you get an error while trying to do this, it may mean that your /usr/local directory (and subdirectories) are owned by the wrong user. If that's the case, I would consider deleting your /usr/local directory and reinstalling Homebrew correctly. Alternatively, you can override the error by prefixing the last command with sudo and entering your admin password:

$ sudo chmod 755 /usr/local/bin
半寸时光 2024-10-16 22:41:42

这是 ruby​​ 的一项安全功能,您可以通过运行以下命令来更改目录 /usr/local/bin 的权限以消除此问题:

sudo chmod go-w /usr/local/bin

并在提示符下输入密码。

不需要需要更改所有权,并且也不应该按照 Ryan 建议删除 /usr/local(这将要求您重建迄今为止已完成的所有内容),该目录由 root 拥有,这是通常的方式。

This is a security feature of ruby, you can change permissions on the directory /usr/local/bin to get rid of this by running:

sudo chmod go-w /usr/local/bin

and entering your password on the prompt.

You do not need to change ownership and neither should delete /usr/local as Ryan suggested (that would require you to rebuild everything you´ve accomplished so far), the directory is owned by root and this is the usual way.

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