0

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 [email protected]

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).

3
  • 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, 2012 at 3:27
  • Windows 8. I'm using Gow to make Linux commands available to my windows 8 terminal
    – Kevin Lee
    Sep 29, 2012 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, 2012 at 13:26

3 Answers 3

0

Create a simple .bat file with content of @start ssh -N -g -D 9999 -i key.pem [email protected] Save that file wherever you want and create a shortcut to it on your desktop.

2
  • 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, 2012 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, 2012 at 4:28
0

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

0

Add the configuration to the file you find here %userprofile%\.ssh\config, The exact syntax of this file can be found in the docs but it goes something like

Host amazon-ws
   Hostname ec2.compute-1.amazonaws.com
   IdentityFile ~/.ssh/key.pem
   User ec2-user

Make sure to store the key in the .ssh folder and make sure it has the access restricted to you only. Now you can ssh to the server by typing ssh amazon-ws or indeed create a batch script ssh amazon-ws. On my (Windows 10) system the @start is not required but MS has been messing with PS Microsoft Terminal etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .