My setup is the following:
Ais where I start
Bis the gateway machine
Cis the destination.
B I have setup SSH public key authentication but from
C I am not allowed to.
So from node
A I use the following incantation which actually works from a different machine (Ubuntu 14.04):
sshpass -p secretpass ssh -oProxyCommand="ssh -W %h:%p username@B" username@C
… however, when I try from a different location with another machine (Ubuntu 16.04 - though I doubt that's relevant), the invocation of
sshpass promptly returns without any kind of output and an exit code (obtained with
echo $?) of 6.
More puzzling is the fact that if I do the steps separately, they succeed:
A: $ ssh username@B (directly access B without being prompted for password) B: $ ssh username@C (prompted for password, provided 'secretpass') C: $ (reached my destination)