Monday, March 14, 2011

SSH to a server through a bastion host with a single command

With command-line SSH, it's easy, just do:

ssh -t <intermediate> ssh <destination>

With putty, the following batch file will do the trick (pass the destination host as the first argument):

SET DATFILE="%TEMP%\bastion.tmp"
echo ssh %1 > "%DATFILE%"
start putty -load "<putty session name>" <intermediate> -t -m "%DATFILE%"

No comments:

Post a Comment