Open a PuTTY session via SSH from HTML

Schweeeps Posted messages 7 Status Member -  
Schweeeps Posted messages 7 Status Member -
Hello,

I would like to be able to launch an SSH connection to the desired device by clicking on an HTML link. For this, I have two scripts: one in .reg and the other in .vbs (the .reg calls the .vbs when clicking on the link, and the .vbs calls to launch the desired program to open the link). However, I can open PuTTY but it keeps rejecting the connection with an error message like: "Network Error: Connection Refused."

Here is the script calling PuTTY.exe:

If WScript.Arguments.Length>0 Then
Dim param
Dim a
Dim b
Dim wshell

' PATH to PuTTY
Dim PuTTY_PATH
PuTTY_PATH= "C:\Program Files\PuTTY\putty.exe""

param = Replace(WScript.Arguments.Item(0),"%20"," ")
b = Replace(param,"\","/")
a = Split(b, "://")
Set wshell = CreateObject("WScript.Shell")

If InStr(a(1),"ssh")>0 then
'Wscript.echo """" & PuTTY_PATH & a(1) & """" & " /ACCEPTHOSTKEYS"
wshell.Run """" & PuTTY_PATH & a(1) & """" & " /ACCEPTHOSTKEYS"
Else
wshell.Run """" & PuTTY_PATH & a(1) & """"
end if
End If

The HTML link pointing to the desired session:

<a href="putty://HKEY_CURRENT_USER/Software/SimonTatham/PuTTY/Sessions/RG-1 -load RG-1 -ssh -P 22 10.X.X.X">

PS: The initial idea was to use PuTTY Connection Manager since we have a database of connections listing all our devices, but due to errors related to the puttycm.log file, I tried only with PuTTY. However, if someone knows how to resolve this .log issue, I would appreciate it if you could let me know.

Thank you in advance for your help!

Configuration: Windows / Firefox 52.0

1 answer

Schweeeps Posted messages 7 Status Member
 
Problem solved, it was due to the incorrect link. Here is the correct link if someone needs to set up a solution of this type: putty://HKEY_CURRENT_USER/Software/SimonTatham/PuTTY/Sessions -load RG-1 -pw password
0