case 4663 - subscription server ssh link opens ssh://root@server in Windows Terminal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 10:49:53 -07:00
parent d28588dca9
commit cb7f79342d

View File

@@ -27,39 +27,18 @@ export default {
methods: {
openUrl() {
if (this.value) {
window.open(`ssh:${this.value}`, "ssh");
//case 4663: ssh://root@host is the form OpenSSH understands; "ssh:host" (the PuTTY-era link) is not
window.open(`ssh://root@${this.value.trim()}`, "ssh");
}
}
}
};
/*
TO USE THIS:
Must have a SSH URI handler set in registry on windows to open putty like this:
TO USE THIS (case 4663): Windows must open ssh:// links in Windows Terminal, which runs Windows' own OpenSSH
(it uses the keys in the KeePassXC SSH agent). The registry handler, under HKEY_CLASSES_ROOT\ssh\shell\open\command:
----------------
Windows Registry Editor Version 5.00
"C:\Users\<you>\AppData\Local\Microsoft\WindowsApps\wt.exe" ssh "%1"
[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
@="%%ProgramFiles%%\\PuTTY\\putty.exe"
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -Command \"$val='%l'; $val = $val.TrimEnd('/');if ($val.StartsWith('ssh://')) { $val = $val.SubString(6) };if ($val.StartsWith('ssh:')) { $val = $val.SubString(4) }; & 'C:\\Program Files\\PuTTY\\putty.exe' \"$val\"\""
----------------
Also in putty need to set default to use pagent agent and then open the keys in KeePass so relies on a lot specific to us but it works great
https://documentation.help/PuTTY/config-saving.html#S4.1.2
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "$val='%l'; $val = $val.TrimEnd('/');if ($val.StartsWith('ssh://')) { $val = $val.SubString(6) };if ($val.StartsWith('ssh:')) { $val = $val.SubString(4) }; & 'C:\Program Files\PuTTY\putty.exe' "$val""
plus the "URL Protocol" value on HKEY_CLASSES_ROOT\ssh so the browser offers it.
*/
</script>