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

If you allocate a tty (ssh -t command) that should do your bash login and run all your dot files (same as bash -i or sudo -i command)

I usually put things in .bashrc and have to check for a terminal before doing any output as that breaks rsync/scp/sftp if you have any output in there.

@kevin