Package manager Homebrew (I'm on OS X, but I'm curious about Unix-based security in general, as it pertains to directory permissions) set the owner of /usr/local/bin
to my user (it's root
by default, right?), which means that now I can install executables by simply moving them to /usr/local/bin
(no sudo
required).
- Am I right about this, that normally
/usr/local/bin
is owned byroot
? - Isn't chowning
/usr/local/bin
with your normal user a huge security issue, because now any software that I run can install programs on my behalf without my password being required?
From their FAQ, this is to avoid the dangerous practice of having to run arbitrary code off the internet as root when installing packages. It's a reasonable compromise for most users - Homebrew's generally used on a single person's development machine, not production multi-user servers.
For why it doesn't just install in your
~
, see the earlier FAQ question "Why does Homebrew prefer I install to/usr/local
?".