I can only get to hostB from hostA, and I want to run commands on hostB.
ssh -t $hostA ssh -t $hostB "
echo 'Hello World!'
echo 'Test!'
"
At the moment, this will connect to hostA then hostB and the script will pause. As soon as i type exit (from hostB) I return to hostA, the 2 echo commands are printed and then automatically exits from hostA.
How can I run commands on hostB?