Apply jumphost's .bashrc to server during ssh -J command?

Posted in Super User:

With the following topology:

    +----------+       +--------+       +--------------+
    |clienthost| ====> |jumphost| ====> |restrictedhost|
    +----------+       +--------+       +--------------+

This successfully allows me to ssh into restrictedhost :

ssh -oProxyCommand="ssh -W %h:%p me@jumphost" me@restrictedhost

and results in an uncustomized bash shell:

Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-45-generic x86_64)
Last login: Mon Nov 12 16:23:06 2018 from

What I want is to carry my dotfile from jumphost (not the client, that's more complicated) to restrictedhost so that, among other things, I get my personalized prompt:

bash Mon Nov 12  16:36:21 ~/ me@MacBook-Pro>

How can I apply jumphost:/tmp/.bashrc file to the shell at restrictedhost?

What I do know

  1. When there is no jumphost involved, this gives me my bash customizations:

    ssh me@unrestricted  "echo "$(cat ${HOME}/.bashrc | base64 -w 0)" | base64 --decode > /tmp/${USER}_bashrc; cd /tmp/; bash --rcfile /tmp/${USER}_bashrc"
  2. If I directly apply 1. to the jump, I get no command prompt (or other bash customizations) at all:

    ssh -oProxyCommand="sshpass -p Empty$paces ssh -W %h:%p devteam@man1-pqa" devteam@queue1-pqa "bash --rcfile /tmp/_bashrc"