I can put this in
/etc/environment and all users will have it:
As I understand it,
/etc/environment sets initial environment variables, then
.bashrc and similar happen later.
This results in something like
#> echo $PATH /opt/my/bin:/usr/local/sbin:/usr/sbin
As it happens,
/opt/my/bin and the files within it are not owned by root but by other intermediate-level administrators. On a shared system this opens the door to exploits if a sub-root administrator goes rogue, or is somehow tricked into pushing out a malicious (or vulnerable) file whose name clashes with a system tool.
As part of a defence-in-depth strategy it would seem a sensible precaution to have
/opt/my/bin come to the right of everything else. (Paranoid users and script authors will type
/sbin/foo <args> but let's not rely on that.)
Can I include a directory in
PATH in such a way that
a) all users have it, including newly-created users, without pushing out individual
.bashrc (or similar) files to them, and
b) takes effect after
PATH has been set to include
/bin, and friends?