Skip to main content
1 of 2
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 
Stéphane Chazelas
  • 586.2k
  • 96
  • 1.1k
  • 1.7k