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%"

Sunday, March 6, 2011

Fix for communicating with Pageant from a cygwin process

As I mentioned previously, Pageant's security measures reject messages coming from cygwin processes (and their children). I submitted a patch that fixes this for charade. The trick is to copy the security descriptor from the Pageant process so they'll be an exact match. Any app should be able to use this same technique.

Sadly, the Putty folks have failed to incorporate the change into winpgntc.c.