I want to put a shortcut on my desktop for a command that launches an SSH tunnel. Here's my tunnel connection:

ssh -N -g -D 9999 -i key.pem ec2-user@ec2.compute-1.amazonaws.com

I want this command to be easily accessible from my desktop. How can I make a shortcut for this? My OS is Windows 8. The ssh command works on my command line because I installed Gnu On Windows (gow).

  • 1
    what OS? Are you using plain vanilla ssh of some sort, or putty? Does putting the command as a shell script or batch file work? – Journeyman Geek Sep 29 '12 at 3:27
  • Windows 8. I'm using Gow to make Linux commands available to my windows 8 terminal – Kevin Lee Sep 29 '12 at 3:35
  • if it doesn't exist, there should be a question as to how to have an ssh tunnel launch with only one click. I would love to know how to do that... – Wijagels Nov 6 '12 at 13:26

Create a simple .bat file with content of @start ssh -N -g -D 9999 -i key.pem ec2-user@ec2.compute-1.amazonaws.com Save that file wherever you want and create a shortcut to it on your desktop.

  • what the hell man, it starts hundreds of command line process in a loop. my computer hangs and i need to power it off. – Kevin Lee Sep 29 '12 at 4:23
  • Ouch. That's not supposed to happen. :/ "@start" is just supposed to launch ssh process so that it does not leave an empty command prompt window hanging. Where did you save that bat file? – Mxx Sep 29 '12 at 4:28

Either you called the created batch file "start" or "ssh" and it's actually calling itself; leaving you with lot's of command windows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.