运行Ruby命令时,路径040777下PATH中不安全的世界可写目录/Users/username [英] Insecure world writable dir /Users/username in PATH, mode 040777 when running Ruby commands

查看:285
本文介绍了运行Ruby命令时,路径040777下PATH中不安全的世界可写目录/Users/username的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行gem -v之类的Ruby命令时,出现此错误:

When I run Ruby commands like gem -v I get this error:

/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4: 警告:不安全的世界可写目录 /Users/kristoffer进入PATH模式040777

/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4: warning: Insecure world writable dir /Users/kristoffer in PATH, mode 040777

1.6.2

首先,我不明白这是什么意思.根据echo $PATH,/Users/kristoffer不在我的路径中. echo $PATH的结果是:

First of all I don't understand what this means. /Users/kristoffer is not in my path according to echo $PATH. The result of echo $PATH is:

/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/bin

如您所见,PATH非常干净.只是默认路径+添加的RVM.

As you can see, the PATH is pretty clean. Just the default path + what RVM added.

我看过其他与此类似的帖子,其中建议的解决方法是运行chmod go-w path/to/folder

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

但是,我很确定使Home文件夹不可写是一个坏主意,对吗?我已经使用磁盘工具"修复了权限,但我的主文件夹"中的权限没有发现任何问题.

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?

推荐答案

您的主文件夹只能由您写,而不能由其他任何人写. gem抱怨此问题的原因是您的PATH文件夹位于(不安全的)主文件夹中,这意味着任何想通过重命名/移动.rvm文件夹并将其替换为冒名顶替者来入侵您的文件夹.

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.

要修复您的主文件夹,请运行chmod go-w /Users/kristoffer.如果在访问PATH中任何内容的过程中还有其他不安全的文件夹,则应以类似方式对其进行修复.

To fix your home folder, run 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.

顺便说一句,磁盘实用程序无法修复此问题的原因是,它只能修复作为操作系统一部分安装的文件(请参见

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). 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.

这篇关于运行Ruby命令时,路径040777下PATH中不安全的世界可写目录/Users/username的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆