On Cygwin, I want a Bash script to:
You could launch the ssh with a & a the end, to put it in the background and grab its id when doing. Then you just have to do a kill of that id when you're done.
ssh
&
kill