Skip to main content
added 74 characters in body
Source Link
Stéphane Chazelas
  • 586.2k
  • 96
  • 1.1k
  • 1.7k

bash does read ~/.bashrc though even when non-interactive when invoked over ssh when compiled with #define SSH_SOURCE_BASHRC as it is on Debian and derivatives at least (a misfeature IMO, but would comecomes handy to you here).

So you could add to the top of ~/.bashrc on the remote host:

if [ -n "$SSH_CLIENT" ] && [ "$SHLVL" = 0 ] && [ -n "${-##*[il]*}" ]; then . /etc/profile . ~/.bash_profile fi 

bash does read ~/.bashrc though even when non-interactive when invoked over ssh (a misfeature IMO, but would come handy to you here).

So you could add to the top of ~/.bashrc on the remote host:

if [ -n "$SSH_CLIENT" ] && [ "$SHLVL" = 0 ] && [ -n "${-##*[il]*}" ]; then . /etc/profile . ~/.bash_profile fi 

bash does read ~/.bashrc though even when non-interactive when invoked over ssh when compiled with #define SSH_SOURCE_BASHRC as it is on Debian and derivatives at least (a misfeature IMO, but comes handy to you here).

So you could add to the top of ~/.bashrc on the remote host:

if [ -n "$SSH_CLIENT" ] && [ "$SHLVL" = 0 ] && [ -n "${-##*[il]*}" ]; then . /etc/profile . ~/.bash_profile fi 
Source Link
Stéphane Chazelas
  • 586.2k
  • 96
  • 1.1k
  • 1.7k

bash does read ~/.bashrc though even when non-interactive when invoked over ssh (a misfeature IMO, but would come handy to you here).

So you could add to the top of ~/.bashrc on the remote host:

if [ -n "$SSH_CLIENT" ] && [ "$SHLVL" = 0 ] && [ -n "${-##*[il]*}" ]; then . /etc/profile . ~/.bash_profile fi