Can PuTTY open SSH link similar to Terminal for Macintosh?

4

3

I’ve got a SSH link (ssh://) in 1Password that if I was using a Macintosh I could just click and have it open a session in Terminal. Is there a way to click an SSH link (ssh://) in Windows and have PuTTY open up the session?

mtpultz

Posted 2015-03-06T01:37:11.490

Reputation: 143

Welcome to Super User! Decent question, but one semantic thing: Since this site deals with many different topics, when you describe something for a “Macintosh” or a “Mac” as “MAC” that could be misinterpreted as the networking term “MAC address” (media access control address) by someone casually skimming the questions. – JakeGould – 2015-03-06T01:56:57.963

Answers

4

PuTTY unfortunately does not associate itself with the ssh:// URLs.

You can associate an application with a protocol manually. See the MSDN article Registering an Application to a URI Scheme.

Basically you add a registry key like:

[HKEY_CLASSES_ROOT\ssh]
@="URL: SSH Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
@="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\",0"

[HKEY_CLASSES_ROOT\ssh\shell]

[HKEY_CLASSES_ROOT\ssh\shell\open]

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\""

Though the above passes a whole URL to the 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 PuTTY.

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


I do not know 1Password, but a similar application KeePass can parse the URL and pass only its certain parts to the application. So it can strip the ssh:// for you.

See KeePass override rules.


On Windows, 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)

Martin Prikryl

Posted 2015-03-06T01:37:11.490

Reputation: 13 764