warning: Insecure world writable dir /usr/local/bi

2019-01-03 08:15发布

Every time I run this command rails server:

warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

I searched for a solution here and they said to type: chmod go-w /usr/local/bin

But I get this error:

chmod: Unable to change file mode on /usr/local/bin: Operation not permitted

I am using OS X by the way.

12条回答
甜甜的少女心
2楼-- · 2019-01-03 08:24

Try: sudo chmod go-w /usr/local/bin

The /usr/local/bin directory is owned by the root (i.e. administrator) account, so even if you can write to it, you can't change the permissions on it. The sudo command means "run the following command as root", and works a lot like clicking that lock icon in the System Preferences dialogs.

查看更多
虎瘦雄心在
3楼-- · 2019-01-03 08:28

You need to run

sudo chmod o-w -R /usr/local 
查看更多
别忘想泡老子
4楼-- · 2019-01-03 08:28

This should resolve your problem: chmod go-w {/path/of/user}

查看更多
时光不老,我们不散
5楼-- · 2019-01-03 08:29

I have had the same issue in OSX. It can be fixed by running Disk Utilities to Repair Permissions. I agree with Peter Nixey: in my case it is caused when my 3G dongle installs or reinstalls its driver. Repairing Permissions afterward fixes the issue.

查看更多
欢心
6楼-- · 2019-01-03 08:29

If you're running OSX and getting this often, another good thing to consider is to use a built-in OSX permissions fixing tool. If you didn't change the mode of your directories, something else did and there's a chance that other directories have overgenerous permissions as well - this tool will reset them back all to factory defaults, which is a good security idea. There's a great guide on the Apple stackextange about this very process.

查看更多
聊天终结者
7楼-- · 2019-01-03 08:31

Even I came across similar problem. I use KDE on ubuntu 12 and while playing around in my home folder I had accidently changed permissions for Group and Others as "can view and modify content" by right clicking in my home folder and then properties and forgot all about it.

My warning was:

warning: Insecure world writable dir /home/my_home_folder in PATH, mode 040777

So in my case it was the home folder. I did undid the modifications of permissions and I stopped getting those warnings when running the rails server or rake tasks to run my tests.

查看更多
登录 后发表回答