On OS X, but may also apply to *NIX. This question was asked/answered previously, and I know it's safe to chown on /usr/local for my admin user account, which I've done to install git with homebrew (using brew instal git).sudo chown -R $USER:admin /usr/localNow I'm thinking I should change ownership back to root.Does it matter who owns /usr/local?
sudo chown -R $USER:admin /usr/local - revert back to ROOT?
permissions;osx;directory structure;homebrew
Let's start with some history. /usr/local is typically used to store user programs/data that were not installed with the base operating system. Commonly, when you make programs from source using automake, they will install somewhere under /usr/local. Because the main operating system itself doesn't rely on this directory, permissions are really up to the administrators preference.Now, we can also consider this from another angle. When you have user +r or +w or +x privileges on a directory, those permissions will only apply to the owner of that directory. Typically, user privileges are higher than the group or all privileges, which means that the owner of /usr/local will have elevated privileges over that of other accounts. Now, if the group and/or all privileges are equal to or greater than the privileges of user on that directory, then who the actual owner is isn't as important.So, the question you need to ask yourself is what users will be using the stuff located in /usr/local, and do you care whether other users have access to the same stuff? Your answer will probably effect not only the user who owns this directory, but what the user, group and all permissions will be on that directory.Using home-brew, it's usually a good idea to have this directory owned by the user administering the home-brew package system. For more of a shared system, it is more common that this directory will be owned by root, as even though this directory is user-controlled, often the administrator of the system wants to have control over what gets deposited into this directory.As a reference, here's an example of a stock Linux (Ubuntu) machine, followed by a stock Mac OS X machine:user@ubuntu:~$ ls -ld /usr/localdrwxr-xr-x 10 root root 4096 Sep 10  2013 /usr/localMac:~ user$ ls -ld /usr/localdrwxrwxr-x  12 root  admin  408 12 Apr 04:32 /usr/local/