JumpSquares – Launching SSH in Chrome
JumpSquares is a FANTASTIC tool and I have written about it before.
JumpSquares is a bookmarking tool where you create bookmarks or “squares” which support configuring a “jump” to different connections such as RDP, SSH, VNC, etc. I use it to keep track of my home lab, setting up the JumpSquares for my RDP, SSH, and HTTP/S links to the different components in the lab.
One issue is the launching of SSH sessions from a hyperlink. Works in FireFox, does not work in Chrome. Chrome is my browser of choice (It does work great in FireFox using the FireSSH plugin).
There is already a simple solution which includes a javascript file and a couple of registry keys to get RDP/VNC to launch from a hyperlink. The instructions for running VNC and RDP from a hyperlink can be found here. I took this (most of the work was done for me) and modified it a bit to allow SSH sessions to be launched from a ssh:// hyperlink as well.
First download putty and place it in a directory C:\Utilities (you can place it anywhere you want but you will need to modify the SSH_Launch.js and SSH.reg files with the location of putty.exe if you do not put it in C:\Utilities).
Then create a SSH.js file containing the following code and place it in C:\Windows
var destination=(WScript.Arguments(0)) var search='ssh://' var sshexe='C:\\Utilities\\putty.exe' destination=destination.replace(search, '') destination=destination.replace('/', '') var ws = new ActiveXObject("WScript.Shell") ws.Exec(sshexe + " " + destination)
Create a file called SSH.reg containing the following information and run it to add the registry entries.
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\ssh] @="URL:SSH Connection" "URL Protocol"="" [HKEY_CLASSES_ROOT\ssh\DefaultIcon] @="C:\\Utilities\\putty.exe" [HKEY_CLASSES_ROOT\ssh\shell] [HKEY_CLASSES_ROOT\ssh\shell\open] [HKEY_CLASSES_ROOT\ssh\shell\open\command] @="wscript.exe C:\\WINDOWS\\ssh_launch.js %1"
Now when I click on a SSH JumpSquare in Chrome a putty session is launched to the destination specified in the ssh:// hyperlink.
I tested this on Windows 8.x and Windows 7.