SSH SCP Hyperlink

March 13th, 2010 Leave a comment Go to comments

Following on from a previous post about creating and using an RDP Hyperlink on a computer running Windows, I have written another two .bat files for use with SSH and SCP protocols.

SSH Hyperlink

sshoptions.png

The first .bat file allows for easy installation/uninstallation of the SSH hyperlink association. It is used for a hyperlink with an associated prefix of ssh://. The bat file will invoke a 3rd party SSH client and establish a connection to the host.

To create and use a hyperlink that is prefixed by ssh:// you will first need to download the latest copy of putty.exe - HERE

Save or move putty.exe (rename to this if different) to C:\WINDOWS\System32\

Download ssh.bat - HERE

Extract and run ssh.bat to create the scp:// hyperlink association on your computer.

SCP Hyperlink

scpoptions.png

The second .bat file allows for easy installation/uninstallation of the SCP hyperlink association. It is used for a hyperlink with an associated prefix of scp://. The bat file will invoke a 3rd party SCP client and establish a connection to the host.

To create and use a hyperlink that is prefixed by scp:// you will first need to download the latest copy of WinSCP.exe - HERE (use the link for 'Portable executables')

Save or move WinSCP.exe (rename to this if different) to C:\WINDOWS\System32\

Download scp.bat - HERE

Extract and run scp.bat to create the scp:// hyperlink association on your computer.

Notes

After completing the above, any hyperlinks prefixed with ssh:// and/or scp:// will automatically be opened and a connection attempt made.

A hyperlink of:

ssh://someserver

would run putty.exe and attempt to connect to 'someserver'.

For more info about using these hyperlinks on webpages and within Zenoss check:

RDP Hyperlink

  1. Bill
    March 8th, 2011 at 17:53 | #1

    I get the following error(s) when I try to open my ssh:// link...

    ----------------
    Windows Script Host

    Script: C:\WINDOWS\hyperlink-ssh.js
    Line: 7
    Char: 1
    Error: The system cannot find the file specified.

    Code: 80070002
    Source: WshShell.Exec

    Any ideas?

    Thanks,
    Bill

  2. James Clements
    March 9th, 2011 at 09:05 | #2

    @Bill

    Can you give me a little more information about your environment? What OS are you using? What browser are you testing this with?

  3. Bill
    March 9th, 2011 at 20:42 | #3

    I'm using...

    Windows 7 Pro (all updates)
    Firefox 3.6.15 (latest version)

  4. Chris Carlson
    March 11th, 2011 at 04:17 | #4

    @Bill
    line 7 is trying to execute putty. did you copy the putty executable to C:\winnt\system32 ?

  5. Anton
    January 14th, 2012 at 10:49 | #5

    Any solution to this? I get the same problem, it works if i try to run
    hyperlink-ssh.js 10.254.4.1 from the cmd-

  6. January 22nd, 2012 at 00:53 | #6

    Hi,

    just copy putty.exe in a different directory on your path and modify the c:\Windows\hyperlink-ssh.js script accordingly. E.g.:

    var server=(WScript.Arguments(0))
    var prefix='ssh://'
    var app="C:\\temp\\putty.exe"
    server=server.replace(prefix, '')
    server=server.replace('/', '')
    var shell = new ActiveXObject("WScript.Shell")
    shell.Exec(app + " " + server)

  7. Allen
    October 26th, 2012 at 19:28 | #7

    I am running Windows 7 and having the same issue. I can run the script from the command line, but I get the same error when trying to execute from a hyperlink. Any suggestions?

  8. Swooper
    April 5th, 2013 at 08:28 | #8

    For Win7 64bit. If you guys still getting that error, try putting it under this directory rather than system32.

    C:\Windows\SysWOW64\putty.exe

  9. Anil
    June 11th, 2014 at 21:17 | #9

    @Swooper

    this works for me. Thanks

*

code