Skip to content

peet-citc/windows-ssh-protocol-handler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSH Protocol Handler for Windows

Forked from vbyrd, inspired by thorstenkramm and quickly updated to enable putty.exe. ** needs updating **

Description

An SSH Protocol Handler Powershell Script for opening SSH connections in Windows.

When set as the protcol handler for SSH it can open links passed by your browser.

Use at your own risk. I haven't extensively tested this and I do not profess to be fluent in Powershell Scripting. Fixes and cleanup are welcome.

Features:

  • Parses passed SSH links such as ssh://someone@someserverip:22 and attempts to santize the input
  • Verifies the required applications are installed
  • Allows you to choose between OpenSSH, plink and Putty SSH Clients
  • Contructs the arguments required by Windows Terminal and the SSH Client

Requirements

Usage

Basic usage of the script involves calling it via powershell. The first argument should be the URL to parse.

powershell .\ssh-protocol-handler.ps1 ssh://<username>@<ipAddress|hostname>:<port>

URL:Protocol SSH can be set in the Windows Registry to point to this script via the included add-ssh-handler.reg. You MUST change the <user> value in the reg file before importing it. As with anything that adds to the registry, be cautious when editing and importing.

powershell "C:\Users\<user>\Documents\PowerShell\Scripts\ssh-protocol-handler.ps1" %1

Script Options:

The script can be customized by modifying the options listed at the top of the script file.

  • $sshPreferredClient : Set the SSH Client you would like Windows Terminal to call
    • Default: 'putty'
    • Supported Options: 'openssh, plink, putty'
  • $sshVerbosity : Set if you would like the SSH Client to show more information
    • Default: $false
    • Supported Options: $true, $false
  • $sshConnectionTimeout : Set the time OpenSSH will wait for connection in seconds before timing out
    • Default: <emtpyString> - We will let OpenSSH decide based on the system TCP timeout
    • Supported Options: <integer>
    • Note: Only applies to OpenSSH
  • $wtProfile : Set the profile Windows Terminal will use
    • Default: <emtpyString> We will let Windows Terminal decide based on its defaults
    • Supported Options: <windowsTerminalProfileName>

About

An SSH Protocol Handler script for opening SSH connections in Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%