Add command to Chrome to open selected host name in PuTTY

14,885

You can make use of the Context Menu Search Chrome Extension.

It can pass the selected text to URLs only though. So you have to use a URL like ssh://%s/ and associate PuTTY with the ssh:// protocol.

PuTTY unfortunately does not associate itself. But you can do it manually. See MSDN article Registering an Application to a URI Scheme.


You can go even a step further and create a user script that turns the host name to clickable ssh:// link.

Inspired by your question, I've wrote a user script to inject SFTP link "Open in WinSCP" to Amazon EC2 management console. You can easily modify it for the ssh:// and "Open in PuTTY".


Though the above passes a whole URL to PuTTY command-line. And PuTTY does not understand the ssh:// prefix. So you would have to add a wrapper script that strips the ssh:// and passes only a user and a host to the PuTTY.

For that see:
https://johnsofteng.wordpress.com/2009/05/12/launch-putty-from-browser/

See also Can PuTTY open SSH link similar to Terminal for Macintosh?


WinSCP 5.9 (and newer) registers itself to handle the ssh:// URL and opens the session specified by the URL in PuTTY.

(I'm the author of WinSCP)

Share:
14,885

Related videos on Youtube

user310685
Author by

user310685

Updated on September 18, 2022

Comments

  • user310685
    user310685 over 1 year

    Every time I have to copy the AWS EC2 public DNS and open PuTTY and connect.

    Public DNS: ec2.us-west-1.compute.amazonaws.com
    

    As an alternative, how can I add an on select this public DNS and right show option open with PuTTY for Chrome [ec2.us-west-1.compute.amazonaws.com] (like for example "Search Google for 'something'")
    and then on click run an command in cmd say like putty --default-profile selectPublicDNS

    Please give me an idea an easy way to do this.