简体   繁体   English

运行 Ruby 命令时,PATH 中不安全的世界可写目录/用户/用户名,模式 040777

[英]Insecure world writable dir /Users/username in PATH, mode 040777 when running Ruby commands

When I run Ruby commands like gem -v I get this error:当我运行像gem -v这样的 Ruby 命令时,出现以下错误:

/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4: warning: Insecure world writable dir /Users/kristoffer in PATH, mode 040777 /Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4:警告:不安全的世界可写目录 /Users/kristoffer 在 PATH,模式 040777

1.6.2 1.6.2

First of all I don't understand what this means.首先我不明白这是什么意思。 /Users/kristoffer is not in my path according to echo $PATH .根据echo $PATH , /Users/kristoffer 不在我的路径中。 The result of echo $PATH is: echo $PATH的结果是:

/Users/kristoffer/.rvm/gems/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/gems/ruby-1.9.2-p180@global/bin:/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin /Users/kristoffer/.rvm/gems/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/gems/ruby-1.9.2-p180@global/bin:/Users/kristoffer/.rvm/ rubies/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/垃圾桶

As you can see, the PATH is pretty clean.如您所见,PATH 非常干净。 Just the default path + what RVM added.只是默认路径 + RVM 添加的内容。

I've seen the other posts similar to this where the recommended way to solve the issue is to run chmod go-w path/to/folder我看过与此类似的其他帖子,其中推荐的解决问题的方法是运行chmod go-w path/to/folder

However, I'm pretty sure that it's a bad idea to make my Home folder non-writeable, right?但是,我很确定让我的主文件夹不可写是个坏主意,对吧? I've repaired permissions using Disk Utility and it didn't find anything wrong with the permissions on my Home folder.我已经使用磁盘工具修复了权限,它没有发现我的主文件夹的权限有任何问题。

Any idea of what the problem is and how I can fix it?知道问题是什么以及如何解决吗?

Your home folder should only be writable by you, not by anyone else.您的主文件夹应该只能由您写入,不能由其他任何人写入。 The reason gem is complaining about this is that you have folders in your PATH that are inside your (insecure) home folder, and that means that anyone who wants to could hack you by renaming/moving your.rvm folder and replacing it with an impostor. gem 抱怨此问题的原因是您的 PATH 中有位于(不安全的)主文件夹中的文件夹,这意味着任何想要入侵的人都可以通过重命名/移动 your.rvm 文件夹并将其替换为冒名顶替者来破解您.

To fix your home folder, run chmod go-w /Users/kristoffer .要修复您的主文件夹,请运行chmod go-w /Users/kristoffer If there are any other insecure folders on the way to anything in your PATH, you should fix them similarly.如果在通往 PATH 中任何内容的途中有任何其他不安全的文件夹,您应该以类似方式修复它们。

BTW, the reason that Disk Utility didn't repair this is that it only repairs files installed as part of the OS (see Apple's KB article on the subject ).顺便说一句,磁盘工具没有修复它的原因是它只修复作为操作系统的一部分安装的文件(请参阅Apple 的有关该主题的知识库文章)。 There is an option to repair home folder permissions if you boot from the install DVD and run Password Reset from the Utilities menu, but I'm not sure if it resets the permissions themselves or just ownership.如果您从安装 DVD 启动并从实用程序菜单运行密码重置,则有一个修复主文件夹权限的选项,但我不确定它是否会重置权限本身或只是所有权。

I kept getting this in my prompt.我一直在提示中得到这个。

在此处输入图像描述

I couldn't get it quite right with my command prompt but this ended up working.我的命令提示符无法完全正确,但这最终起作用了。

在此处输入图像描述

Recently this just happened to me and it has to do with a bug in upgrading to Mac OSX 10.9.3.最近这只是发生在我身上,它与升级到 Mac OSX 10.9.3 的错误有关。 Looks like the upgrade changes the permissons to the User folder.看起来升级将权限更改为用户文件夹。 Here's an explanation and a fix:这是一个解释和修复:

http://derflounder.wordpress.com/2014/05/16/users-folder-being-hidden-with-itunes-11-2-installed-and-find-my-mac-enabled/ http://derflounder.wordpress.com/2014/05/16/users-folder-being-hidden-with-itunes-11-2-installed-and-find-my-mac-enabled/

chmod 755 /Users/<username>

Should fix the problem...应该解决问题...

it says that the directory Users/username is insecure, you can fix that by running sudo chmod go-w Users/username它说目录 Users/username 不安全,您可以通过运行 sudo chmod go-w Users/username 来修复它

I found a solution.我找到了解决方案。 Like user2952657, I got this warning with vagrant up after upgrading to OSX 10.9.3.与 user2952657 一样,在升级到 OSX 10.9.3 后,我收到了 vagrant 的警告。 Updating iTunes to 11.2.1 was all I needed to do to get the warning to stop.将 iTunes 更新到 11.2.1 是我需要做的所有事情才能让警告停止。

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

相关问题 警告:PATH模式040777下不安全的世界可写目录/ usr - warning: Insecure world writable dir /usr in PATH, mode 040777 如何在PATH中解决不安全的世界可写dir / usr,在Ruby上模式040777警告? - How to solve Insecure world writable dir /usr in PATH,mode 040777 warning on Ruby? 运行“rails s”后如何修复“路径中不安全的世界可写目录/mnt/c,模式040777”错误 - How to fix "Insecure world writable dir /mnt/c in PATH, mode 040777" error after running "rails s" 在PATH中获取警告“不安全世界可写dir / home / chance”,模式040777用于rails和gem - Getting the warning “Insecure world writable dir /home/chance ” in PATH, mode 040777 for rails and gem 警告:不安全的世界可写目录…/osx/bin 在 PATH,模式 040777 与 Homebrew - warning: Insecure world writable dir …/osx/bin in PATH, mode 040777 with Homebrew 运行ruby脚本时出现错误的“ PATH中不安全的世界可写dir foo” - Erroneous “Insecure world writable dir foo in PATH” when running ruby script 禁止警告“不安全的世界可写目录/some/dir/” - Suppress warning “Insecure world writable dir /some/dir/” 耙任务提示不安全的可写目录 - Rake tasks prompt insecure writable dir “zsh:找不到命令:”运行Ruby命令时 - "zsh: command not found:" when running Ruby commands 项目外部的路径,Ruby Dir - Path outside of project, Ruby Dir
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM