Linux sysadmin question (since it's no longer possible to find actual answers via search on the Internet):

How can I configure the PATH to *always* have a specific directory in it when a shell (Bash) is started, regardless of whether the shell is login/non-login, interactive/non-interactive, etc.?

The normal steps (adding a file in /etc/profile.d which adds to the path) work for login/interactive shells, but not for shells opened by sshd with a command to execute (no pty).

#Linux #SysAdmin #LinuxSysAdmin

@kevin

Search for the invocation section of man bash.

It lists the order the configuration files are processed in, /etc/profile should be first and for both interactive and non-interactive shells.

Though something else later might override setting the PATH?

Also you might also need to add an export PATH in in whatever script you change the path in.