I have a machine called ic
that I can ssh to. There is another machine, fw
, that is on a completely different VLAN, and I cannot talk to it. ic
is on both my VLAN and the VLAN that fw
uses, and so my usual procedure for sshing to fw is to ssh into ic
and from there ssh into fw
. If I wanted to script this action, however, how could I get it to work?
I tried ssh root@ic "ssh root@fw"
, but this results in the message Pseudo-terminal will not be allocated because stdin is not a terminal
, and then I get three messages from fw
, presumably because it has null input:
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
What's the best way to script this?