I am trying to make a webpage which will have the entire inventory of servers that our team manages in the form of a table. I am using a simple LAMP stack and the inventory input as a CSV file.
The table has three columns: Hostname, IP address and device serial number.
While this works perfectly fine, I want to take this a step further and make every IP address in the table a hyperlink, clicking which will open an SSH client, which will connect to that IP address. Any cues to how this can be done? I was hoping there would be something like the the mailto:
tag which opens an email client (Outlook window).
When the window opens for the connection, you can type GET / HTTP/1.1 and hit Enter and then type Host: example.com , or whatever the name is for the website, e.g., www.microsoft.com, etc. You can also see what your entered and the site's response in the PuTTY log file.
I've done it following the info of this blog post.
For future reference in case the original page becomes missing, here is the process:
you cannot directly map the ssh:// scheme to PuTTY, but you can map it to an intermediary script which will in turn launch PuTTY with the right arguments. Mine is called putty_ssh.bat and has the following content:
@echo off
set var=%1
set extract=%var:~6,-1%
start "C:\Program Files (x86)\PuTTY\putty.exe" %extract%
the script has to be registered in the registry. You can just create a ssh.reg file with the following content and open it (customizing last line as needed):
REGEDIT4
[HKEY_CLASSES_ROOT\ssh]
@="URL:ssh Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="\"C:\\path\\to\\putty_ssh.bat\" %1"
When I click on ssh://
links in web pages, it now opens PuTTY.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With