Reputation: 500
I'm not very familiar with Terminal / Command line on Mac, outside of basic commands (cd, ls, pwd ect.) And I was trying to install "compass" for Sass. http://compass-style.org/install/ When I tried the first line that they give
$ gem update --system
I got an error in terminal saying that the file permissions were wrong for /usr/bin folder. So I updated that folder to 777, but then I got a warning message stating that
Insecure world writable dir /usr/bin in PATH
So I thought it didn't like that I set the permissions so high, so I updated the permissions for that folder to 744, thinking I would still be able to do what I needed..... Now I've been locked out of that folder, and I can't do much in terminal, because it seems like most commands originate from that folder? I can't change the permissions back I can't use sudo, or many other commands. It seems like a lot of the commands are located inside of the /usr/bin folder.
How can fix this? Is there a way to change the permissions back in this folder? Can I update the permissions of the /usr folder and have it modify all sub-folders?
Upvotes: 1
Views: 1646
Reputation: 125788
Disk Utility's repair permissions feature should be able to fix this. Run Disk Utility, select your startup volume in the disk & volume sidebar on the left, select the "First Aid" tab on the right, then click "Repair Disk Permissions". It's possible the system is broken to the point where that can't run, but if it can run it should fix the permissions on /usr/bin.
I'm not familiar with the gem system, but in general your customizations/updates/etc shouldn't be modifying /usr/bin or anything in it. Your stuff should go someplace like /usr/local/bin, and the permissions for that can be something like 775 (never 777), and it can be assigned to the admin group so you can write to it.
Upvotes: 2
Reputation: 1
try: sudo chmod go-w /usr/local/bin
There is a post for more reference: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Upvotes: 0