logoalt Hacker News

feelameeyesterday at 12:12 PM2 repliesview on HN

can someone explain security consideration of placing scripts into $HOME? Some time ago I moved all my scripts to /usr/local/bin, because I feel that this is better from security perspective.


Replies

Galanweyesterday at 12:31 PM

There are no security implications, on the contrary.

It is objectively cleaner to keep your user scripts in your home, that way they are only in _your_ PATH, whereas putting them in /usr/[local/]bin implicitly adds them to every [service] user on the machine, which I can see creating obscure undesired effets.

Not even mentioning the potential issues with packages that could override your scripts at install, unexpected shadowing of service binaries, setuid security implications, etc.

layer8yesterday at 1:30 PM

Someone with access to your home dir can also set your $PATH and aliases to anything they want, so I don’t see any extra security considerations here.