Permissions/ownership of /usr/local/bin
By default, the owner and group of /usr/local
and all subdirectories (including bin
) should be root.root
and the permissions should be rwxr-xr-x
. This means that users of the system can read and execute in (and from) this directory structure, but cannot create or edit files there. Only the root
account (or an administrator using sudo
) should be able to create and edit files in this location. Even though there is only one user on the system, it's generally a bad idea to change permissions of this directory structure to writable to any user other than root
.
I would suggest placing your script/binary/executable into /usr/local/bin
using the root account. It's a good habit to get into. You could also place the script/binary/executable into $HOME/bin and make sure $HOME/bin is in your $PATH.
See this question for more discussion: Where should a local executable be placed?
The usual place to put your own scripts is ~/bin
, and then add this directory to your PATH
.