Skip to content

Instantly share code, notes, and snippets.

@asika32764
Last active September 9, 2022 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asika32764/0422d7e161f5f33294e8b12779c315fd to your computer and use it in GitHub Desktop.
Save asika32764/0422d7e161f5f33294e8b12779c315fd to your computer and use it in GitHub Desktop.
Register ssh URL link protocol (ssh://) in Windows

Register ssh URL link (protocol) in Windows

Download register-ssh-protocol.reg and double click to install it.

You can change the position of open-ssh-protocol.js before install.

Then, download the open-ssh-protocol.js file to C:\bin\.

You can also change the terminal app path as you want.

Now, you can open SSH connect after click ssh:// link.


Here is some popular ssh client path:

  • XShell: '"C:\\Program Files (x86)\\NetSarang\\Xshell 7\\Xshell.exe" ' + url
  • Windows Terminal: 'wt "' + url.replace('://', '') + '"'
  • PuTTY: '"C:\\Program Files\\PuTTY\\putty.exe" -ssh ' + url

Credit: This reg file is a clone of https://github.com/vbyrd/windows-terminal-ssh-protocol-handler

var url = WScript.Arguments(0);
// Remove trailing slash
url = url.replace(/\/+$/, '');
var shell = new ActiveXObject('WScript.Shell');
shell.Exec('"C:\\Program Files (x86)\\NetSarang\\Xshell 7\\Xshell.exe" ' + url);
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes\WTHandler.URLHandler.1]
[HKEY_CURRENT_USER\SOFTWARE\Classes\WTHandler.URLHandler.1\shell]
[HKEY_CURRENT_USER\SOFTWARE\Classes\WTHandler.URLHandler.1\shell\open]
[HKEY_CURRENT_USER\SOFTWARE\Classes\WTHandler.URLHandler.1\shell\open\command]
@="wscript \"C:\\bin\\open-ssh-protocol.js\" \"%1\" //E:JScript"
[HKEY_CURRENT_USER\SOFTWARE\WTHandler\Capabilities]
"ApplicationDescription"="Windows Terminal SSH Protocol Handler"
"ApplicationName"="Windows Terminal SSH Protocol Handler"
[HKEY_CURRENT_USER\SOFTWARE\WTHandler\Capabilities\UrlAssociations]
"ssh"="WTHandler.URLHandler.1"
"ssh1"="WTHandler.URLHandler.1"
"ssh2"="WTHandler.URLHandler.1"
[HKEY_CURRENT_USER\SOFTWARE\RegisteredApplications]
"Windows Terminal SSH Protocol Handler"="Software\\WTHandler\\Capabilities"
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts]
"WTHandler.URLHandler.1_ssh"=dword:00000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment