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 I think you need to add it to .bashrc
@frank Unfortunately no - adding in /etc/bash.bashrc or in ~/.bashrc does not set PATH when running 'ssh <host> export'.
@frank Adding 'export FOO=bar' in `/.bashrc` does work if it is added at the top - the standard .bashrc on Debian doesn't do anything for non-interactive shells. Grrr.